This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 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... |