Submission #1093161

#TimeUsernameProblemLanguageResultExecution timeMemory
1093161LuvidiBliskost (COI23_bliskost)C++17
100 / 100
115 ms16360 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll, ll> #define pii pair<int, int> #define fs first #define sc second #define pb push_back void solve(){ int n,q; cin>>n>>q; string s1,s2; cin>>s1>>s2; int s=0; for(int i=0;i<n;i++){ if(i%2)s+=s1[i]-s2[i]; else s+=s2[i]-s1[i]; } if(s%26)cout<<"ne\n"; else cout<<"da\n"; while(q--){ int x; char c; cin>>x>>c; x--; if(x%2)s-=s1[x]-s2[x]; else s-=s2[x]-s1[x]; s1[x]=c; if(x%2)s+=s1[x]-s2[x]; else s+=s2[x]-s1[x]; if(s%26)cout<<"ne\n"; else cout<<"da\n"; } } int main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); solve(); }
#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...