/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Wrong Answer 4ms 532.0 KiB
#3 Wrong Answer 5ms 508.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int ll
#define all(x) (x).begin(), (x).end()
#define f(i, n) for (int i = 0; i < n; i++)
#define trace(x) cerr << #x << ": " << x << '\n'
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        string s, p;
        cin >> s >> p;
        for (int i = 0; i < n - 1; i++)
        {
            if (s[i] == p[i])
                continue;
            s[i] = (s[i] ^ '0' ^ '1');
            if (s[i] == '0')
                s[i + 1] = '1';
            else
                s[i + 1] = '0';
        }
        if (s == p)
            cout << "YES\n";
        else
            cout << "NO\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 14:37:40
Judged At
2026-01-06 14:37:40
Judged By
Score
0
Total Time
5ms
Peak Memory
532.0 KiB