From ea9b2ba8783f7f4f625e349ba0b5de0d29e33fe1 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Mon, 15 Nov 2021 13:20:52 +0800 Subject: [PATCH] CF1598A Computer Game R62650380 --- Luogu/CF1598A/CF1598A.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Luogu/CF1598A/CF1598A.cpp diff --git a/Luogu/CF1598A/CF1598A.cpp b/Luogu/CF1598A/CF1598A.cpp new file mode 100644 index 00000000..e4e6c9cf --- /dev/null +++ b/Luogu/CF1598A/CF1598A.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; +}