Submission #8086

#TimeUsernameProblemLanguageResultExecution timeMemory
8086dohyun0324Crayfish scrivener (IOI12_scrivener)C++98
34 / 100
116 ms10552 KiB
char last; int p[100010][21],a[100010],pos[100010],n,len[100010]; char str[100010]; void Init() {} void TypeLetter(char L) { int i; n++; p[n][0]=pos[n-1]; for(i=1;i<=20;i++) { p[n][i]=p[p[n][i-1]][i-1]; } pos[n]=n; len[n]=len[p[n][0]]+1; str[n]=L; } void UndoCommands(int U) { int i; n++; pos[n]=pos[n-U-1]; len[n]=len[pos[n]]; } char GetLetter(int P) { int i; int m,dir=pos[n]; m=len[n]-P-1; for(i=0;i<=20;i++) { if(m&(1<<i)) { m-=(1<<i); dir=p[dir][i]; } } return str[dir]; }
#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...