/ SeriousOJ /

Record Detail

Wrong Answer


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

Code


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#ifndef ONLINE_JUDGE
    #define dbg(x) cout << #x << ":- " << x << "\n"
#else
    #define dbg(x)
#endif
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(),x.rend()
#define MOD 1000000007
//-----------------------------------------------------------------------------//
void print(vector<ll>arr){for(int i=0;i<arr.size();i++){cout<<arr[i]<<" ";}
cout<<endl;}
void print(map<ll,ll>mpp){for(auto x:mpp){cout<<x.first<<"-->"<<x.second<<"\n";}
cout<<endl;}
void print(set<ll>s){for(auto x:s){cout<<x<<" ";}cout<<endl;}
//------------------------------------------------------------------------------//

int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin>>t;
while(t--){
ll n;
cin>>n;
string s,t;
cin>>s>>t;
if(n==1){
    if(s==t)cout<<"YES\n";
    else cout<<"NO\n";
    continue;
}
bool check=true;
for(int i=0;i<n-1;i++){
    if(s[i]!=s[i+1]&&t[i]==t[i+1]){
        check=false;
    }
}
if(!check)cout<<"NO\n";
else cout<<"YES\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:39:18
Judged At
2026-01-06 14:39:19
Judged By
Score
0
Total Time
2ms
Peak Memory
532.0 KiB