/ SeriousOJ /

Record Detail

Wrong Answer


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

Code

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

#define ll long long

void solve(){
    int n;
    string a, b;
    cin >> n >> a >> b;
    if(n < 2){
        cout << "NO\n";
        return;
    }else if(n == 2 && b[0] == b[1]){
        cout << "NO\n";
        return;
    }

    for(int i = 2 ; i < n ; i++){
        if(b[i-2] == b[i-1] && b[i-1] == b[i]){
            cout << "NO\n";
            return;
        }
    }
    cout << "YES\n";
}

int main(){
    ios_base::sync_with_stdio(0), cin.tie(0);
    int t = 1;
    cin >> t;
    while(t--){
        solve();
    }
    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:40:59
Judged At
2026-01-06 14:41:00
Judged By
Score
0
Total Time
2ms
Peak Memory
532.0 KiB