# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
310889 | juggernaut | Crayfish scrivener (IOI12_scrivener) | C++14 | 390 ms | 51704 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int up[1000005][20],depth[1000005],pos[1000005],timer,tmp,v,i;
char res[1000005];
void Init(){}
void TypeLetter(char ch){
res[++v]=ch;
up[v][0]=tmp;
depth[v]=depth[tmp]+1;
tmp=v;
pos[++timer]=tmp;
for(i=1;i<20;i++)up[tmp][i]=up[up[tmp][i-1]][i-1];
}
void UndoCommands(int num){
pos[++timer]=tmp=pos[timer-1-num];
}
char GetLetter(int p){
p++;
int to=tmp;
for(i=19;i>=0;i--)if(depth[up[to][i]]>=p)to=up[to][i];
return res[to];
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |