1 条题解

  • 1
    @ 2024-10-26 20:49:23

    预估题目难度是中等偏下的,只要好好看题,就知道这道题是一道很简单的很单纯的ifelse的一个判断。把每一种情况自己考虑清楚答案就出来了,具体每种情况可以自己慢慢把题目读一遍。

    #include<bits/stdc++.h>
    #define int long long
    #define endl '\n'
    using namespace std;
    
    void solve()
    {
    	int n;
    	cin >> n;
    	if(n == 1) {
    		int x, y, z;
    		cin >> x >> y >> z;
    		if(z == 1) {
    			if(x == y) cout << "No" << endl;
    			else cout << "Yes" << endl;
    		}
    		else if(z == 0) cout << "Yes" << endl;
    	}
    	else if(n == 2) {
    		int x, y, z, xx, yy, zz;
    		cin >> x >> y >> z >> xx >> yy >> zz;
    		if(z == 1) {
    			if(x == y) cout << "No" << endl;
    			else if(x != y) {
    				if(zz == 1) {
    					if(xx == yy) cout << "No" << endl;
    					else if(xx != yy) {
    						if(xx == y && yy == x) cout << "No" << endl;
    						else cout << "Yes" << endl;
    					}
    				}
    				else if(zz == 0) {
    					if(xx == x && yy == y) cout << "No" << endl;
    					else cout << "Yes" << endl;
    				}
    			}
    		}
    		else if(z == 0) {
    			if(zz == 1) {
    				if(xx == yy) cout << "No" << endl;
    				else if(xx != yy) {
    					if(xx == x && yy == y) cout << "No" << endl;
    					else cout << "Yes" << endl;
    				}
    			}
    			else if(zz == 0) cout << "Yes" << endl;
    		}
    	}
    }
    
    signed main()
    {
        ios::sync_with_stdio(false);
        cin.tie(0), cout.tie(0);
    
        int _T_ = 1;
    	cin >> _T_;
    
        while(_T_ --) solve();
        return 0;
    }
    

    琬琬学姐手把手教你写冒泡排序

    信息

    ID
    1034
    时间
    1000ms
    内存
    256MiB
    难度
    9
    标签
    递交数
    101
    已通过
    11
    上传者