/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Wrong Answer 1ms 324.0 KiB
#3 Wrong Answer 4ms 320.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;

int main() {
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        string s;
        cin >> s;
        string p;
        cin >> p;
        for (int i = 0; i+1 < n; i++) {
            if (s[i] != p[i]) {
                if (s[i] == '0') {
                    s[i+1] = '0';
                } else {
                    s[i+1] = '1';
                }
            }
        }
        cout << (s[n-1] == p[n-1] ? "YES" : "NO") << "\n";
    }
}

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 14:34:37
Judged At
2026-01-06 14:34:37
Judged By
Score
0
Total Time
4ms
Peak Memory
532.0 KiB