#include<bits/stdc++.h>
using namespace std;
const int logN = 17;
const int N = 2e5 + 5;
static int node, lca[N][logN], C, S, W[N];
char col[N];
void Init() {
}
void TypeLetter(char L) {
W[++S] = ++C;
col[C] = L;
lca[C][0] = node;
node = C;
for(int i = 1; i <= logN; i++)
lca[node][i] = lca[lca[node][i-1]][i-1];
}
void UndoCommands(int U) {
node = W[S - U];
W[++S] = node;
}
char GetLetter(int P) {
int tt = node;
for(int i = logN; i >= 0; i--)
if((1 << i) <= P) {
P -= (1 << i);
tt = lca[tt][i];
}
return col[tt];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
15972 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
15972 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
15972 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
73 ms |
15972 KB |
futex (syscall #202) was called by the program (disallowed syscall) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
114 ms |
15972 KB |
Program hung waiting for input |
2 |
Halted |
0 ms |
0 KB |
- |