// #include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <vector>
#include <iomanip>
#include <string>
#include <queue>
#include <set>
#include <deque>
using namespace std;
#define int long long
#define endl "\n"
#define fi first
#define se second
const int M=26;
const int inf = 1e9;
const int LOG=17;
const int N=2e5+5;
int n , m , c , w , k , t=1 , q=1 , x , y , z , l , r;
void solve()
{
cin >> n >> q;
string s,t;
cin >> s >> t;
c=0;
for (int i=0;i<n;i++){
if (i%2){
c+=t[i]-s[i];
}
else{
c+=s[i]-t[i];
}
}
cout << (c%26==0 ? "da" : "ne") << endl;
for (int j=0;j<q;j++){
char p;cin >> x >> p;
x--;
if (x%2){
c-=t[x]-s[x];
s[x]=p;
c+=t[x]-s[x];
}
else{
c-=s[x]-t[x];
s[x]=p;
c+=s[x]-t[x];
}
cout << (c%26==0 ? "da" : "ne") << endl;
}
}
signed main()
{
ios::sync_with_stdio(0);//DO NOT USE IN INTERACTIVE
cin.tie(0), cout.tie(0);//DO NOT USE IN INTERACTIVE
cout << fixed << setprecision(9);
srand(time(0));
// int t=1;
// cin >> t;
for (int _=1;_<=t;_++){
solve();
q++;
}
}
| # | 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... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |