제출 #247085

#제출 시각아이디문제언어결과실행 시간메모리
247085lakshith_크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++14
100 / 100
751 ms90616 KiB
char ops[1000005]; int prev[1000005][20], size[1000005], sz; int go[1000005]; void Init(){ sz = 1; } void TypeLetter(char L){ int p = sz; go[p] = p; ops[p] = L; if(p)prev[p][0]=go[p-1]; for(int i=1;prev[p][i-1];i++) prev[p][i] = prev[prev[p][i-1]][i-1]; size[p]=size[go[p-1]]+1; sz++; } void UndoCommands(int U){ go[sz]=go[sz-U-1]; sz++; } char GetLetter(int P){ int pos = go[sz-1]; int o = P+1; for(int i=19;i>=0;i--) if(size[prev[pos][i]]>=o) pos = prev[pos][i]; return ops[pos]; }
#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...