Submission #520342

#TimeUsernameProblemLanguageResultExecution timeMemory
520342krit3379Crayfish scrivener (IOI12_scrivener)C++17
100 / 100
431 ms89540 KiB
#include<bits/stdc++.h> using namespace std; #define N 1000005 struct A{ char c; int len,p[20]; }s[N]; int sz; void Init(){} void TypeLetter(char c){ s[sz+1]={c,s[sz].len+1,sz}; sz++; for(int i=1;i<20;i++) s[sz].p[i]=s[s[sz].p[i-1]].p[i-1]; } void UndoCommands(int u){ s[sz+1]=s[sz-u]; sz++; } char GetLetter(int p){ int now=sz; p=s[now].len-p-1; for(int i=0;i<20;i++) if(p&(1<<i)) now=s[now].p[i]; return s[now].c; }
#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...