Submission #574270

#TimeUsernameProblemLanguageResultExecution timeMemory
574270mosiashvililukaCrayfish scrivener (IOI12_scrivener)C++14
34 / 100
1091 ms12760 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...