Submission #1036267

#TimeUsernameProblemLanguageResultExecution timeMemory
1036267stdfloatCrayfish scrivener (IOI12_scrivener)C++17
34 / 100
1058 ms16208 KiB
#include <bits/stdc++.h> using namespace std; const int N = (int)1e6 + 1; int q, cnt, cur; vector<char> ch(N); vector<int> num(N), pr(N), d(N); void Init() {} void TypeLetter(char L) { num[++q] = ++cnt; ch[cnt] = L; pr[cnt] = cur; d[cnt] = d[cur] + 1; cur = cnt; } void UndoCommands(int U) { q++; num[q] = cur = num[q - U - 1]; } char GetLetter(int P) { P = d[cur] - P - 1; int x = cur; while (P--) x = pr[x]; return ch[x]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...