Submission #954504

#TimeUsernameProblemLanguageResultExecution timeMemory
954504willychanBliskost (COI23_bliskost)C++17
0 / 100
0 ms348 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; //#include<bits/extc++.h> //__gnu_pbds string ans[2]={"ne","da"}; int main(){ ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0); int n,q;cin>>n>>q; string s;cin>>s; string b;cin>>b; int cnt1=0; int cnt2=0; for(auto i : s) cnt1+=i-'a'; cnt1%=2; for(auto i : b) cnt2+=i-'a'; cnt2%=2; cout<<ans[cnt1==cnt2]<<"\n"; for(int i=0;i<q;i++){ int p;cin>>p; p--; char x;cin>>x; cnt1-=s[p]-'a'; cnt1+=x-'a'; s[p]=x; cnt1%=2; if(cnt1<0) cnt1+=2; cout<<ans[cnt1==cnt2]<<"\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...