Submission #430829

#TimeUsernameProblemLanguageResultExecution timeMemory
430829rumen_mCrayfish scrivener (IOI12_scrivener)C++17
26 / 100
222 ms13208 KiB
# include <bits/stdc++.h> using namespace std; char last; vector <char> t; vector <int> pos; vector <int> par; stack <char> st; bool fl = false; int prevv=-1, ver=-1; vector <char> w; void Init() { prevv = -1; ver = -1; t.clear(); pos.clear(); par.clear(); //st.clear(); fl = false; } void TypeLetter(char L) { last = L; ver++; pos.push_back(ver); t.push_back(L); par.push_back(prevv); prevv = ver; } void UndoCommands(int U) { int k = pos[pos.size()-U-1]; pos.push_back(k); prevv = k; } char GetLetter(int P) { if(!fl) { for(int i = prevv; i!=-1; i =par[i]) { st.push(t[i]); } while(!st.empty()) { w.push_back(st.top()); st.pop(); } fl= true; } return w[P]; //return last; }
#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...