Submission #954467

#TimeUsernameProblemLanguageResultExecution timeMemory
954467GrandTiger1729Bliskost (COI23_bliskost)C++17
28 / 100
9 ms3004 KiB
#include <bits/stdc++.h> using namespace std; const int K = 26; int main() { cin.tie(0)->sync_with_stdio(0); int n, q; cin >> n >> q; string a, b; cin >> a >> b; int cur = 0; for (int i = 0; i < n; i++) { (cur += (i % 2 == 0 ? 1 : -1) * ((b[i] - a[i] + K) % K) + K) %= K; } cout << (cur == 0 ? "da" : "ne") << '\n'; while (q--) { int i; char x; cin >> i >> x; i--; (cur += (i % 2 == 0 ? 1 : -1) * (x - a[i]) + K) %= K; a[i] = x; cout << (cur == 0 ? "da" : "ne") << '\n'; } return 0; }
#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...