Accepted
Code
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
#ifdef SUBLIME
freopen("inputf.in", "r", stdin);
freopen("outputf.out", "w", stdout);
freopen("error.txt", "w", stderr);
#endif
int tt;
cin >> tt;
while (tt--) {
int n;
string s, p;
cin >> n >> s >> p;
int cnt = count(p.begin(), p.end(), '0');
if ((cnt == 0 || cnt == n) && (s != p)) cout << "NO\n";
else cout << "YES\n";
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1233 B. Make Binary Strings Equal
- Contest
- Happy New Year 2026
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2026-01-06 15:27:52
- Judged At
- 2026-01-06 15:27:52
- Judged By
- Score
- 100
- Total Time
- 2ms
- Peak Memory
- 560.0 KiB