제출 #1123672

#제출 시각아이디문제언어결과실행 시간메모리
1123672pccBliskost (COI23_bliskost)C++17
100 / 100
165 ms5884 KiB
#include <bits/stdc++.h> using namespace std; #ifdef DEBUG string dbmc = "\033[1;38;2;57;197;187m", dbrs = "\033[0m"; #define debug(x...) cout << dbmc << "[" << #x << "] : ", dout(x) void dout() { cout << dbrs << endl; } template <typename T, typename ...U> void dout(T t, U ...u) { cout << t << (sizeof...(u) ? ", " : ""); dout(u...); } #else #define debug(...) 0 #endif #define ll long long #define pll pair<ll,ll> #define pii pair<int,int> #define fs first #define sc second #define tiii tuple<int,int,int> #define tlll tuple<ll,ll,ll> int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); int n,q; cin>>n>>q; string a,b; cin>>a>>b; int cnt[2] = {}; for(int i = 0;i<n;i++){ cnt[i&1] += (26+b[i]-a[i])%26; } cout<<(cnt[0]%26 == cnt[1]%26?"da\n":"ne\n"); while(q--){ int p; char c; cin>>p>>c; p--; cnt[p&1] -= (26+b[p]-a[p])%26; a[p] = c; cnt[p&1] += (26+b[p]-a[p])%26; cout<<(cnt[0]%26 == cnt[1]%26?"da\n":"ne\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...