Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define el '\n'
void run_case(int tc) {
int n;
cin >> n;
string s, p;
cin >> s >> p;
for (int i = 0; i < n - 1; i++) {
if (s[i] != p[i]) {
if (p[i] == '0') {
s[i] = '0';
s[i + 1] = '1';
} else {
s[i] = '1';
s[i + 1] = '0';
}
}
}
cout << (s == p ? "YES\n" : "NO\n");
}
int32_t main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int _t = 1;
cin >> _t;
for (int i = 1; i <= _t; i++) {
run_case(i);
}
}
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:00:42
- Judged At
- 2026-01-06 15:00:43
- Judged By
- Score
- 0
- Total Time
- 6ms
- Peak Memory
- 768.0 KiB