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>
int main(){
std::ios::sync_with_stdio(0);
std::cin.tie(0);
int n,q;
std::cin>>n>>q;
std::string st1,st2;
std::cin>>st1>>st2;
int taltsum=0;
for(int i=0;i<n;i++){
taltsum+=i%2?-st1[i]:st1[i];
taltsum-=i%2?-st2[i]:st2[i];
}
std::cout<<(taltsum%26==0?"da\n":"ne\n");
for(int i=0;i<q;i++){
int a;
char c;
std::cin>>a>>c;
a--;
taltsum-=a%2?-st1[a]:st1[a];
st1[a]=c;
taltsum+=a%2?-c:c;
std::cout<<(taltsum%26==0?"da\n":"ne\n");
}
}
# | 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... |