# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1204478 | PlayVoltz | 크레이피쉬 글쓰는 기계 (IOI12_scrivener) | C++20 | 256 ms | 82740 KiB |
#include <bits/stdc++.h>;
using namespace std;
int p=0, node=0;
char vect[1000005];
int twok[1000005][20], depth[1000005];
void Init(){}
void TypeLetter(char l){
++node;
vect[node]=l;
twok[node][0]=p;
depth[node]=depth[p]+1;
for (int i=1; i<20; ++i)twok[node][i]=twok[twok[node][i-1]][i-1];
p=node;
}
void UndoCommands(int u){
++node;
vect[node]=vect[node-u-1];
depth[node]=depth[node-u-1];
for (int i=0; i<20; ++i)twok[node][i]=twok[node-u-1][i];
p=node;
}
char GetLetter(int p){
int c=node;
for (int i=0, k=depth[node]-p-1; i<20; ++i)if (k&(1<<i))c=twok[c][i];
return vect[c];
}
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... |