Submission #202082

#TimeUsernameProblemLanguageResultExecution timeMemory
202082DavidDamianCrayfish scrivener (IOI12_scrivener)C++11
34 / 100
1080 ms11512 KiB
#include<bits/stdc++.h> using namespace std; int node[1000006]; int NEXT_FREE_INDEX=1; int n=1; int id[1000006]; char letter[1000006]; int p[1000006]; int len; void Init() { len=-1; id[0]=-1; } void TypeLetter(char L) { node[n]=NEXT_FREE_INDEX; id[NEXT_FREE_INDEX]=id[ node[n-1] ]+1; letter[NEXT_FREE_INDEX]=L; p[NEXT_FREE_INDEX]=node[n-1]; NEXT_FREE_INDEX++; n++; } void UndoCommands(int U) { node[n]=node[n-U-1]; n++; } char GetLetter(int P) { int k=node[n-1]; while(id[k]>P){ k=p[k]; } return letter[k]; }
#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...