# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
120483 | KieranHorgan | Crayfish scrivener (IOI12_scrivener) | C++17 | 185 ms | 64760 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 a[1000005][23], curStep=0, node, i;
void Init() {}
void TypeLetter(char L) {
a[++curStep][21] = L;
a[curStep][22] = a[curStep-1][22]+1;
a[curStep][0] = curStep-1;
copy(a[curStep-1]+1, a[curStep-1]+20, a[curStep]+1);
}
void UndoCommands(int U) { copy(a[curStep-1-U], a[curStep-1-U]+23, a[++curStep]); }
char GetLetter(int P) {
for(i = 21, node = curStep; i >= 0; i--)
if(a[node][22] - (1<<i) >= P+1)
node = a[node][i];
return a[node][21];
}
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... |