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 <iostream>
using namespace std;
int main()
{
int n,q;
cin>>n>>q;
int a[n],x,b[n];
string a1,b1;
cin>>a1>>b1;
char g;
for(int i=0;i<q;i++)
{
cin>>x>>g;
for(int i=0;i<n;i++)
{
a[i]=a1[i]-'a';
b[i]=b1[i]-'a';
}
a[x-1]=g-'a';
for(int i=0;i<n-1;i++)
{
while(a[i]%26<b[i]%26)
{
a[i]++;
a[i+1]++;
}
while(b[i]%26<a[i]%26)
{
b[i]++;
b[i+1]++;
}
}
if(a[n-1]%26!=b[n-1]%26)
{
cout<<"ne";
}
else
{
cout<<"da";
}
}
}
# | 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... |