제출 #713480

#제출 시각아이디문제언어결과실행 시간메모리
713480hkoi크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
0 / 100
305 ms55392 KiB
#include <bits/stdc++.h> using namespace std; const int mxN = 1000005; char s[mxN]; int bin[20][mxN], depth[mxN], it = 1; vector<int> tail = {0}; void Init() { } void TypeLetter(char c) { s[++it] = c; depth[it] = depth[tail.back()] + 1; bin[0][it] = tail.back(); for (int i = 1; i < 20; i++) { bin[i][it] = bin[i-1][bin[i-1][it]]; } tail.push_back(it); } void UndoCommands(int k) { tail.push_back(tail[tail.size()-k-1]); } char GetLetter(int k) { int ret = tail.back(); for (int i = 0; i < 20; i++) { if ((1 << i) & depth[tail.back()-k-1]) ret = bin[i][ret]; } return ret; }
#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...