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>
#include <chrono>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using oset = tree<T,null_type,less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define endl '\n'
using ll = long long;
using ld = long double;
#define no cout<<"NO"<<endl
#define yes cout<<"YES"<<endl
#define da cout<<"da"<<endl
#define ne cout<<"ne"<<endl
#define send ios::sync_with_stdio(false);
#define help cin.tie(0);
void solve(int T);
const int N = 3e5 + 10;
const int M = 405;
const int SQRT = sqrt(N);
const int LOG = 20;
const int INF = 1e12;
const int MOD = 45678;
const ld EPS = 1e-9;
int ans;
int n, m, q, l, r, x, y, mx, mn;
int32_t main(){
#ifdef ZC
auto begin = chrono::high_resolution_clock::now();
#endif
cout<<setprecision(4)<<fixed;
send help;
int tt = 1;
//cin>>tt; //? Comment if no testcases
for(int i = 1;i<=tt;i++){
#ifdef ZC
cout<<"Case "<<i<<": "<<endl;
#endif
solve(i);
}
#ifdef ZC
auto end = chrono::high_resolution_clock::now();
cout<<"Time: "<<chrono::duration_cast<chrono::duration<double>>(end - begin).count()<<endl;
#endif
return 0;
}
string s, t;
inline int calc(int i){
if(i & 1)return s[i] - t[i];
else return t[i] - s[i];
}
void solve(int T){
cin>>n>>q>>s>>t;
int sum = 0;
for(int i = 0;i<n;i++)sum += calc(i);
if(sum % 26 == 0)da;
else ne;
while(q--){
int p;
char v;
cin>>p>>v;
--p;
sum -= calc(p);
s[p] = v;
sum += calc(p);
if(sum % 26 == 0)da;
else ne;
}
}
//Te molam da raboti !!
# | 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... |