/ SeriousOJ /

Record Detail

Accepted


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

Code

#include <bits/stdc++.h>     //   All praise is due to Allah alone, and peace and blessings be
using namespace std;         //         upon him, after whom there is no other Prophet.

int32_t main() {
    cin.tie(0)->sync_with_stdio(false);

    int32_t Case = 1;    cin >> Case;
    for (int T = 1; T <= Case; T++) {

        int n; cin >> n;
        string s, p; cin >> s >> p;

        if(s == p) {
            cout << "YES\n"; continue;
        }

        function<void()> Test_Case = [&]() {
            if(n == 1) {
                cout << "NO\n"; return;
            }
            int cnt = count(p.begin(), p.end(), '0');
            if(cnt == n or cnt == 0) {
                cout << "NO\n";
            }
            else cout << "YES\n";
        };
        Test_Case();
    }
    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:53:43
Judged At
2026-01-06 14:53:45
Judged By
Score
100
Total Time
2ms
Peak Memory
532.0 KiB