#include<bits/stdc++.h>
using namespace std;
int n,q,av,dov;
string s,ss;
void khor(){
if(av==dov){
cout<<"da\n";
}else{
cout<<"ne\n";
}
}
void vorod(){
cin>>n>>q;
cin>>s>>ss;
}
void pre(){
for(int i=0;i<n;i++){
if(i&1){
dov+=(ss[i]-s[i]+26)%26;
}else{
av+=(ss[i]-s[i]+26)%26;
}
}
}
void solve(){
khor();
for(int i=0;i<q;i++){
int a;
char c;
cin>>a>>c;
if(a&1){
dov-=(ss[i]-s[i]+26)%26;
s[i]=c;
dov+=(ss[i]-s[i]+26)%26;
}else{
av-=(ss[i]-s[i]+26)%26;
s[i]=c;
av+=(ss[i]-s[i]+26)%26;
}
khor();
}
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
vorod();
pre();
solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |