# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1026487 | 2024-07-18T06:49:56 Z | vjudge1 | Bliskost (COI23_bliskost) | C++17 | 0 ms | 348 KB |
#include <bits/stdc++.h> using namespace std; #define int long long void f(){ #ifndef ONLINE_JUDGE freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); #endif } signed main(){ ios_base::sync_with_stdio(false); cin.tie(0); //f(); int n, q; cin >>n >> q; vector<int> a(n); int sb=0, sa=0; string s, t; cin >> s>> t; int last=0; for(int i=0; i<n; i++){ if(i%2) sa+=s[i]-t[i]; else sb+=s[i]-t[i]; } if(sa==sb) cout<<"da\n"; else cout<<"ne\n"; while(q--){ int p; cin >> p; p--; char x; cin >> x; if(p%2){ sa-=s[p]-t[p]; s[p]=x; sa+=s[p]-t[p]; } else{ sb-=s[p]-t[p]; s[p]=x; sb+=s[p]-t[p]; } if(sa==sb) cout<<"da\n"; else cout<<"ne\n"; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |