题目大意:是否有逻辑问题。
方法:无脑枚举
代码如下:
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using T = pair<int, int>;
//set<int>S;
//unordered_map<int, int>mp;
const int N = 2e5 + 10;
int a[N];
int main()
{
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int t; cin >> t;
while (t--) {
int n; cin >> n;
int i;
if (n == 1) {
int x, y, z; cin >> x >> y >> z;
if (x == y && z == 1) {
cout << "No" << endl;
}
else cout << "Yes" << endl;
continue;
}
int flag = 1;
int x1, y1, z1; cin >> x1 >> y1 >> z1;
if (x1 == y1 && z1 == 1) {
flag=0;
}
int x2, y2, z2; cin >> x2 >> y2 >> z2;
if (x2 == y2 && z2 == 1) {
flag=0;
}
if (z1 == 0) {
if (x2 == x1 && y2 == y1 && z2 == 1)flag = 0;
}
else {
if (z2 == 0&&x2==x1&&y2==y1) {
flag = 0;
}
if (z2 == 1 && x2 == y1 && y2 == x1)flag = 0;
}
if (flag)cout << "Yes" << endl;
else cout << "No" << endl;
}
return 0;
}