Submission #1114014

#TimeUsernameProblemLanguageResultExecution timeMemory
1114014SalihSahinBliskost (COI23_bliskost)C++14
57 / 100
1058 ms19768 KiB
#include <bits/stdc++.h> #define pb push_back #define int long long using namespace std; const int inf = 1e9 + 10; int modval(int x){ int chl = 26; int res = (x + 26 * inf)%26; return res; } int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, q; cin>>n>>q; string a, b; cin>>a>>b; vector<int> delt(n), tot(2); for(int i = 0; i < n; i++){ delt[i] = a[i] - b[i]; tot[i%2] += delt[i]; } if(modval(tot[0]) == modval(tot[1])) cout<<"da"<<endl; else cout<<"ne"<<endl; while(q--){ int ind; char c; cin>>ind>>c; ind--; tot[ind%2] -= delt[ind]; a[ind] = c; delt[ind] = a[ind] - b[ind]; tot[ind%2] += delt[ind]; if(modval(tot[0]) == modval(tot[1])) cout<<"da"<<endl; else cout<<"ne"<<endl; } return 0; }

Compilation message (stderr)

Main.cpp: In function 'long long int modval(long long int)':
Main.cpp:9:8: warning: unused variable 'chl' [-Wunused-variable]
    9 |    int chl = 26;
      |        ^~~
#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...