#include <bits/stdc++.h>
#define pb push_back
#define int long long
using namespace std;
const int inf = 1e9 + 10;
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int n, q;
cin>>n>>q;
string a, b;
cin>>a>>b;
vector<int> delt(n), tot(2);
for(int i = 0; i < n; i++){
delt[i] = a[i] - b[i];
tot[i%2] += delt[i];
}
if(tot[0] == tot[1]) cout<<"da"<<endl;
else cout<<"ne"<<endl;
while(q--){
int ind;
char c;
cin>>ind>>c;
ind--;
tot[ind%2] -= delt[ind];
a[ind] = c;
delt[ind] = a[ind] - b[ind];
tot[ind%2] += delt[ind];
if(tot[0] == tot[1]) cout<<"da"<<endl;
else cout<<"ne"<<endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |