Submission #954461

#TimeUsernameProblemLanguageResultExecution timeMemory
954461GrandTiger1729Bliskost (COI23_bliskost)C++17
57 / 100
1096 ms8800 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; vector<int> c(n); for (int i = 0; i < n; i++) { c[i] = (b[i] - a[i] + K) % K; } int cur = 0; for (int i = 0; i < n; i++) { cur = c[i] - cur; } cur %= K; cout << (cur == 0 ? "da" : "ne") << '\n'; while (q--) { int j; char x; cin >> j >> x; j--; a[j] = x; c[j] = (b[j] - a[j] + K) % K; cur = 0; for (int i = 0; i < n; i++) { cur = c[i] - cur; } cur %= K; 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...