/ SeriousOJ /

Record Detail

Wrong Answer


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

Code

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#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'
int n;
string s, t;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int tt;
    cin >> tt;
    while (tt--)
    {
        cin >> n >> s >> t;
        if (s == t)
        {
            cout << "YES\n";
            continue;
        }
        if (count(all(t), '1') - count(all(s), '1') ==0 or count(all(t), '1') - count(all(s), '1') == 1)
        {
            cout << "YES\n";
            continue;
        }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 15:49:47
Judged At
2026-01-06 15:49:47
Judged By
Score
0
Total Time
2ms
Peak Memory
532.0 KiB