제출 #1114016

#제출 시각아이디문제언어결과실행 시간메모리
1114016NotLinuxBliskost (COI23_bliskost)C++17
40 / 100
1057 ms10732 KiB
// Author : FatihCihan #include <bits/stdc++.h> using namespace std; #define all(v) v.begin() , v.end() #define sz(a) (int)a.size() void solve(){ int n,q; cin >> n >> q; string s1 , s2; cin >> s1 >> s2; int arr[n]; for(int i = 0;i<n;i++){ arr[i] = s2[i] - s1[i]; if(arr[i] < 0)arr[i] += 26; } auto get = [&]{ int tmp[n] = {0}; for(int i = 0;i<n-1;i++){ while(arr[i] != tmp[i]){ tmp[i] = (tmp[i] + 1) % 26; tmp[i+1] = (tmp[i+1] + 1) % 26; } } if(arr[n-1] == tmp[n-1])return "da"; else return "ne"; }; cout << get() << endl; while(q--){ int pos; char ch; cin >> pos >> ch; pos--; s1[pos] = ch; arr[pos] = s2[pos] - s1[pos]; if(arr[pos] < 0)arr[pos] += 26; cout << get() << endl; } } signed main(){ ios_base::sync_with_stdio(0);cin.tie(0); int testcase = 1;//cin >> testcase; while(testcase--)solve(); cerr << 1000.0 * clock() / CLOCKS_PER_SEC << " ms" << 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...