Wrong Answer
Code
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n; int m;
cin >> n;
for (int i = 0; i < n; i++){
cin >> m; string b1; string b2;
cin >> b1; cin >> b2;
for (int j = 0; j < m - 1; j++){
if (b1[j] != b2[j]){
b1[j] = ((b1[j] == '1') ? '0': '1');
b1[j+1] = ((b1[j+1] == '1') ? '0': '1');
}
}
if (b1 == b2){
cout << "YES" << endl;
}
else{
cout << "NO" << endl;
}
}
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:09:00
- Judged At
- 2026-01-06 15:09:00
- Judged By
- Score
- 0
- Total Time
- 2ms
- Peak Memory
- 532.0 KiB