제출 #683023

#제출 시각아이디문제언어결과실행 시간메모리
683023Hacv16크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
0 / 100
163 ms87280 KiB
#include <bits/stdc++.h> using namespace std; const int MAX = 2e6 + 15; const int ALP = 26; int trie[MAX][ALP], pai[MAX], cur, node; char letter[MAX]; vector<int> states; void Init() {} void TypeLetter(char L) { int id = L - 'a'; if(trie[cur][id] == 0){ trie[cur][id] = ++node; pai[node] = cur; } cur = trie[cur][id]; letter[cur] = L; states.emplace_back(cur); } void UndoCommands(int U) { while(U-- && states.size()) states.pop_back(); cur = states.back(); } char GetLetter(int P) { int aux = cur; string resp = ""; while(aux != 0){ resp += letter[aux]; aux = pai[aux]; } return resp[P]; }
#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...