diff --git a/CodeForces/1598/A/A.cpp b/CodeForces/1598/A/A.cpp new file mode 100644 index 00000000..e4e6c9cf --- /dev/null +++ b/CodeForces/1598/A/A.cpp @@ -0,0 +1,25 @@ +#pragma GCC optimize("Ofast") + +#include + +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; +}