Submission #948062

#TimeUsernameProblemLanguageResultExecution timeMemory
948062AbitoBliskost (COI23_bliskost)C++17
44 / 100
620 ms4856 KiB
#include <bits/stdc++.h> #define F first #define S second #define pb push_back #define ppb pop_back #define ep insert #define endl '\n' #define elif else if #define pow pwr #define sqrt sqrtt //#define int long long #define ll long long typedef unsigned long long ull; using namespace std; const int N=2e5+5; int n,q,a[N]; char s[N],z[N]; int32_t main(){ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); cin>>n>>q; for (int i=1;i<=n;i++) cin>>s[i]; for (int i=1;i<=n;i++) cin>>z[i]; for (int i=1;i<=n;i++) a[i]=((z[i]-'a')-(s[i]-'a')+26)%26; for (int Q=0;Q<=q;Q++){ if (Q){ int i;char c; cin>>i>>c; s[i]=c; a[i]=((z[i]-'a')-(s[i]-'a')+26)%26; } //for (int i=1;i<=n;i++) cout<<a[i]<<' ';cout<<endl; int p=0; for (int i=1;i<n;i++){ //cout<<p<<' '; int x=(a[i]+p)%26; p=(26-x)%26; }//cout<<p<<endl; if ((a[n]+p)%26) cout<<"ne"<<endl; else cout<<"da"<<endl; } 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...