# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
68460 | 2018-08-17T07:31:28 Z | nvmdava | Crayfish scrivener (IOI12_scrivener) | C++17 | 1000 ms | 872 KB |
#include <bits/stdc++.h> using namespace std; char s[1000001]; int now = 0, i = 0, dir[1000001][21], sz[1000001]; void Init() {} int find(int i, int x){ if(sz[i] < x){ return i; } if(sz[i] == x){ return i; } int j = 1; while(sz[i] / (1 << j) * ((1 << j) - 1) > x){ j++; } j--; return find(dir[i][j], x); } void TypeLetter(char L) { s[i] = L; dir[i][0] = now; sz[i] = sz[now] + 1; dir[i][0] = now; for(int j = 1; j < 21; j++){ dir[i][j] = find(now, sz[i] / (1 << j) * ((1 << j) - 1)); } now = i; i++; } void UndoCommands(int U) { now = i - U - 1; s[i] = s[now]; for(int j = 0; j <= 20; j++)dir[i][j] = dir[now][j]; sz[i] = sz[now]; i++; } char GetLetter(int P) { cout<<s[find(i, P + 1)]; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1072 ms | 376 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1090 ms | 376 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1077 ms | 424 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1054 ms | 692 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1082 ms | 872 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |