This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef long double ld;
#define N lli(2e6)
#define MOD lli(1e9 + 7)
#define fast_io ios_base::sync_with_stdio(0); cin.tie(0);
#define heps(v) v.begin(),v.end()
typedef vector<lli> vlli;
typedef pair<lli,lli> plli;
typedef pair<lli,plli> pplli;
typedef vector<plli> vplli;
typedef vector<pplli> vpplli;
typedef map<lli,lli> mlli;
lli t,n,m,k;
string str;
vector<char> bir, ik;
lli topl = 0;
void kont(){
if(topl % 26 == 0)
cout << "da" << endl;
else
cout << "ne" << endl;
}
int main(){
fast_io
cin >> n >> t;
for(lli i = 0;i<n;i++){
char c;
cin >> c;
bir.push_back(c);
}
for(lli i = 0;i<n;i++){
char c;
cin >> c;
ik.push_back(c);
if((n - i) & 1)
topl += ik[i] - bir[i];
else
topl -= ik[i] - bir[i];
}
kont();
while(t--){
char c;
cin >> m >> c;
m--;
if((n - m)&1){
topl -= ik[m] - bir[m];
topl += ik[m] - c;
}else{
topl += ik[m] - bir[m];
topl -= ik[m] - c;
}
bir[m] = c;
kont();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |