Submission #917623

#TimeUsernameProblemLanguageResultExecution timeMemory
917623antonCrayfish scrivener (IOI12_scrivener)C++17
26 / 100
144 ms36276 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long char last; struct CMD{ int prev; char added; CMD(int _prev, char _added){ prev = _prev; added = _added; } }; vector<CMD> tree; string s; void eval(int id){ if(tree[id].prev != -1){ eval(tree[id].prev); if(tree[id].added != ' '){ s.push_back(tree[id].added); } } } void Init() { tree.push_back(CMD(-1, ' ')); } void TypeLetter(char L) { last = L; tree.push_back(CMD(tree.size()-1, last)); } void UndoCommands(int U) { tree.push_back(CMD(tree.size()-1-U, ' ')); } bool evaled = false; char GetLetter(int P) { if(!evaled){ eval(tree.size()-1); evaled = true; } return s[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...