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;
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 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... |