Submission #425693

#TimeUsernameProblemLanguageResultExecution timeMemory
425693SOIVIEONECrayfish scrivener (IOI12_scrivener)C++17
60 / 100
1094 ms21364 KiB
#include <iostream> #include <vector> #include <string> #include <set> #include <algorithm> using namespace std; char last; string cur; vector<string> v; vector<pair<int, int> > logs; vector<int> who; void Init() {} bool oops = true; void TypeLetter(char L) { logs.push_back({1, L}); int oo = who.size(); who.push_back(oo); oops = true; } void UndoCommands(int U) { logs.push_back({2, U}); who.push_back(who.size() - U - 1); oops = true; } string ans = ""; char GetLetter(int P) { if(oops) { oops = false; int cur = who.size()-1; while(cur >= 0) { if(who[cur] == cur) { char lol = logs[cur].second; ans += lol; cur --; } else { cur = who[cur]; } } reverse(ans.begin(), ans.end()); } // cout << "ans = " << ans << "\n"; return ans[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...