제출 #574270

#제출 시각아이디문제언어결과실행 시간메모리
574270mosiashvililuka크레이피쉬 글쓰는 기계 (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...