Submission #1060006

#TimeUsernameProblemLanguageResultExecution timeMemory
1060006aymanrsBliskost (COI23_bliskost)C++17
100 / 100
132 ms24300 KiB
#include<bits/stdc++.h> using namespace std; void solve(){ int n, q;cin >> n >> q; string s, t;cin >> s >> t; int aemo = 0, bemo = 0; int a[n],b[n];for(int i = 0;i < n;i++){ a[i]=s[i]-'a'; b[i]=t[i]-'a'; if(i&1) aemo += 26-a[i]; else aemo += a[i]; if(i&1) bemo += 26-b[i]; else bemo += b[i]; } if(aemo%26 == bemo%26) cout << "da\n"; else cout << "ne\n"; while(q--){ int p;char c;cin >> p >> c; p--;c -= 'a'; if(p&1){ aemo -= 26-a[p]; aemo += 26-c; } else { aemo -= a[p]; aemo += c; } a[p]=c; if(aemo%26 == bemo%26) cout << "da\n"; else cout << "ne\n"; } } int main(){ ios_base::sync_with_stdio(false); cin.tie(0); solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...