/ SeriousOJ /

Record Detail

Accepted


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

Code

#include<bits/stdc++.h>

using namespace std;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int t;
  cin >> t;
  while(t>0){
    t--;
    int n;
    string x,y;
    cin >> n >> x >> y;
    if(x==y){cout << "YES\n"; continue;}
    bool ok=false;
    for(int i=1;i<n;i++){
      if(y[i-1]!=y[i]){ok=true; break;}
    }
    if(ok){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:33:55
Judged At
2026-01-06 14:33:56
Judged By
Score
100
Total Time
2ms
Peak Memory
764.0 KiB