This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define ppb pop_back
#define ep insert
#define endl '\n'
#define elif else if
#define pow pwr
#define sqrt sqrtt
//#define int long long
#define y1 YONE
typedef unsigned long long ull;
using namespace std;
const int N=105;
int n,q;
char a[N],b[N];
int32_t main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
cin>>n;
for (int i=0;i<3;i++) for (int i=1;i<=n;i++) cin>>a[i];
cin>>q;bool ok=true;
for (int i=1;i<=n;i++) {cin>>b[i];if (b[i]!=a[i]) ok=false;}
if (ok) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
while (q--){
ok=true;
int l,r;char x;cin>>l>>r>>x;
for (int i=l;i<=r;i++) b[i]=x;
for (int i=1;i<=n;i++) if (b[i]!=a[i]) ok=false;
if (ok) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |