Submission #63035

#TimeUsernameProblemLanguageResultExecution timeMemory
63035Bodo171Crayfish scrivener (IOI12_scrivener)C++14
100 / 100
942 ms63292 KiB
char last; const int nmax=1000005; int m[nmax]; void Init() { for(int i=0;i<20;i++) m[(1<<i)]=i;} char st[nmax]; int lev[nmax],state[nmax],tt[nmax][20]; int curr,states,nr,i,b,lg=19; void TypeLetter(char L) { curr=state[states]; st[++nr]=L;state[++states]=nr; tt[nr][0]=curr;lev[nr]=lev[curr]+1; for(i=1;i<=lg;i++) tt[nr][i]=tt[tt[nr][i-1]][i-1]; } void UndoCommands(int U) { states++; state[states]=state[states-U-1]; } char GetLetter(int P) { curr=state[states]; P=lev[curr]-P-1; while(P!=0) { b=m[((P^(P-1))&P)]; curr=tt[curr][b]; P&=(P-1); } return st[curr]; }
#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...