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;
int a,b,c,d,e,i,j,ii,jj,zx,xc,pi,zm[1000009],p[1000009],ZM,P,msh[1000009];
char ch[1000009];
void Init(){
}
void TypeLetter(char L) {
//pi++;p[pi]=p[pi-1];p[pi].push_back(L);
P++;pi++;//ZM++;
p[pi]=P;zm[pi]=zm[pi-1]+1;
ch[P]=L;
msh[pi]=msh[pi-1];
//cout<<pi<<" pi "<<zm[pi]<<" "<<p[pi]<<" "<<msh[pi]<<"\n";
}
void UndoCommands(int U) {
//pi++;p[pi]=p[pi-U-1];
pi++;
zm[pi]=zm[pi-U-1];
p[pi]=P;
msh[pi]=pi-U-1;
//cout<<pi<<" pi "<<zm[pi]<<" "<<p[pi]<<" "<<msh[pi]<<"\n";
}
char GetLetter(int P) {
//return p[pi][P];
P++;
c=pi;
while(1){
if(zm[msh[c]]<P) break;
c=msh[c];
}
zx=p[c]-(zm[c]-P);
return ch[zx];
}
# | 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... |