제출 #1024178

#제출 시각아이디문제언어결과실행 시간메모리
1024178socpite크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
100 / 100
246 ms90540 KiB
#include<iostream> using namespace std; int n = 0; const int maxn = 1e6+5; int st[20][maxn]; char C[maxn]; int dep[maxn], prv[maxn]; void Init() { n = 0; } void TypeLetter(char L) { n++; C[n] = L; prv[n] = n; dep[n] = dep[prv[n-1]] + 1; st[0][n] = prv[n-1]; for(int i = 1; i < 20; i++){ st[i][n] = st[i-1][st[i-1][n]]; } } void UndoCommands(int U) { n++; prv[n] = prv[n - U - 1]; } char GetLetter(int P) { int id = prv[n], d = dep[id] - (P + 1); for(int i = 0; i < 20; i++){ if(d&(1<<i))id = st[i][id]; } return C[id]; }
#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...