1 条题解

  • 0
    @ 2024-11-16 18:17:10

    想想都不用想,肯定是用枚举。

    #include<iostream>
    using namespace std;
    int main()
    {
    	int a, b, c, d, e, f;
    	for (a=0; a < 2; a++)
    	{
    		for (b=0; b < 2; b++)
    		{
    			for (c=0; c < 2; c++)
    			{
    				for (d=0; d < 2; d++)
    				{
    					for (e=0; e < 2; e++)
    					{
    						for (f=0; f < 2; f++)
    						{
    							if ((a + b >= 1) && (a + d == 1) && (a + e + f == 2) && (c + d == 1) && (b + c != 1) && (d + e == 0 || d == 1))
    							{
    								if (a == 1)
    								{
    									cout << "a" << endl;
    								}
    								if (b == 1)
    								{
    									cout << "b" << endl;
    								}
    								if (c == 1)
    								{
    									cout << "c" << endl;
    								}
    								if (d == 1)
    								{
    									cout << "d" << endl;
    								}
    								if (e == 1)
    								{
    									cout << "e" << endl;
    								}
    								if (f == 1)
    								{
    									cout << "f" << endl;
    								}
    							}
    						}
    					}
    				}
    			}
    		}
    	}
    	return 0;
    }
    
    

    信息

    ID
    535
    时间
    1000ms
    内存
    128MiB
    难度
    10
    标签
    递交数
    7
    已通过
    1
    上传者