Submission #130658

#TimeUsernameProblemLanguageResultExecution timeMemory
130658dragonslayeritCrayfish scrivener (IOI12_scrivener)C++14
34 / 100
1071 ms15344 KiB
#include <string> struct String{ int len; char last; int prev; String():last('\0'),prev(-1){ } }str[1000001]; int curr=0; void Init() {} void TypeLetter(char L) { str[curr+1].len=str[curr].len+1; str[curr+1].last=L; str[curr+1].prev=curr; curr++; } void UndoCommands(int U) { str[curr+1]=str[curr-U]; curr++; } char GetLetter(int P) { int move=str[curr].len-1-P; int x=curr; while(move--){ x=str[x].prev; } return str[x].last; }
#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...