Submission #1128936

#TimeUsernameProblemLanguageResultExecution timeMemory
1128936ivazivaBliskost (COI23_bliskost)C++20
0 / 100
0 ms324 KiB
#include <bits/stdc++.h> using namespace std; #define MAXN 1000001 int n,q; string s1,s2; int main() { cin>>n>>q;cin>>s1>>s2;int sum=0; for (int i=0;i<n;i++) { int val=s2[i]-s1[i];sum+=val; if (val<0) sum+='z'-'a'+1; } if (sum%2==0) cout<<"da"<<endl; else cout<<"ne"<<endl; for (int z=0;z<q;z++) { int p;cin>>p;char c;cin>>c; int val1=s2[p-1]-s1[p-1]; if (val1<0) val1+='z'-'a'+1; int val2=s2[p-1]-c; if (val2<0) val2+='z'-'a'+1; sum+=val2-val1;s1[p-1]=c; if (sum%2==0) cout<<"da"<<endl; else cout<<"ne"<<endl; } }
#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...