Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
string s1,s2;
cin>>n>>s1>>s2;
if(s1==s2){
cout<<"YES"<<endl;
continue;
}
if(n==1){
cout<<"NO"<<endl;
continue;
}
bool y=false;
for(int i=1;i<n;i++){
if(s1[i]==s1[i-1]||s2[i]==s2[i-1]){
y=true;
break;
}
}
if(y)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
}
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:44:05
- Judged At
- 2026-01-06 15:44:06
- Judged By
- Score
- 0
- Total Time
- 2ms
- Peak Memory
- 532.0 KiB