Submission #114951

#TimeUsernameProblemLanguageResultExecution timeMemory
114951zoooma13Crayfish scrivener (IOI12_scrivener)C++14
12 / 100
1092 ms179208 KiB
#include <bits/stdc++.h> using namespace std; //#include "grader.cpp" #define MAX_N 5003 struct command{ bool add; char x; }; string curr_text = ""; int curr_comm; vector <command> last[5003]; void Init(){ curr_text = ""; curr_comm = 0; } void TypeLetter(char L){ curr_text += L; last[++curr_comm].push_back({1 ,L}); //cout << curr_comm << " " << curr_text << endl; } void UndoCommands(int U){ ++curr_comm; for(int i=curr_comm-1; i>=curr_comm-U; i--){ for(command&c : last[i]){ if(!c.add) curr_text += c.x; else curr_text.pop_back(); last[curr_comm].push_back({!c.add ,c.x}); } } reverse(last[curr_comm].begin() ,last[curr_comm].end()); //cout << curr_comm << " " << curr_text << endl; } char GetLetter(int P){ return curr_text[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...