Submission #1003441

#TimeUsernameProblemLanguageResultExecution timeMemory
1003441Ausp3xCrayfish scrivener (IOI12_scrivener)C++17
34 / 100
113 ms262144 KiB
// 人外有人,天外有天 // author: Ausp3x #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> typedef long long lng; typedef unsigned int uint; typedef unsigned long long ulng; using namespace std; using namespace __gnu_pbds; int const INF32 = 0x3f3f3f3f; lng const INF64 = 0x3f3f3f3f3f3f3f3f; vector<string> history(1); void Init() { return; } void TypeLetter(char l) { string res = history.back(); res += l; history.push_back(res); return; } void UndoCommands(int u) { history.push_back(history[history.size() - u - 1]); return; } char GetLetter(int p) { return history.back()[p]; } /* int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); Init(); TypeLetter('a'); TypeLetter('b'); cout << GetLetter(1) << endl; TypeLetter('d'); UndoCommands(2); UndoCommands(1); cout << GetLetter(2) << endl; TypeLetter('e'); UndoCommands(1); UndoCommands(5); TypeLetter('c'); cout << GetLetter(2) << endl; UndoCommands(2); cout << GetLetter(2) << endl; return 0; } //*/
#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...