/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 3ms 532.0 KiB
#2 Accepted 2ms 532.0 KiB
#3 Accepted 3ms 532.0 KiB
#4 Accepted 6ms 532.0 KiB
#5 Accepted 5ms 532.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
#define debug(a) cerr << #a << " = " << (a) << nl;
#define ll long long
#define int long long
#define nl '\n'

void jAVA()
{
    int n; string s, t; cin >> n >> s >> t;
    int zs = count(s.begin(), s.end(), '0');
    int os = count(s.begin(), s.end(), '1');
    int zt = count(t.begin(), t.end(), '0');
    int ot = count(t.begin(), t.end(), '1');
    if(s == t) cout << "YES\n";
    else if(!zt or !ot) cout << "NO\n";
    else cout << "YES\n";
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);

    int t = 1, cs = 0;
    cin >> t;
    while (t--){
        // cout << "Case " << ++cs << ": ";
        jAVA();
    }
    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:39:07
Judged At
2026-01-06 14:39:08
Judged By
Score
100
Total Time
6ms
Peak Memory
532.0 KiB