0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-30 17:16:26 +00:00
OI-codes/Luogu/CF1598A/CF1598A.cpp
2021-11-15 13:20:52 +08:00

26 lines
465 B
C++

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
int t, n;
string s[2];
bool flag;
int main() {
std::ios::sync_with_stdio(false);
cin >> t;
while (t--) {
flag = true;
cin >> n >> s[0] >> s[1];
for (int i = 0; i < n; i++) {
if (s[0][i] == '1' && s[1][i] == '1') {
flag = false;
}
}
cout << (flag ? "YES" : "NO") << endl;
}
return 0;
}