This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int mxN = 1000005;
string ans;
vector<string> undo;
void Init() {
return;
}
void TypeLetter(char l) {
ans += l;
undo.push_back(ans);
}
void UndoCommands(int u) {
ans = undo[undo.size()-u-1];
undo.push_back(ans);
}
char GetLetter(int p){
return ans[p];
}
/*
int main() {
Init();
TypeLetter('a');
cout << ans << "\n";
TypeLetter('b');
cout << ans << "\n";
cout << GetLetter(1) << "\n";
TypeLetter('d');
cout << ans << "\n";
UndoCommands(2);
cout << ans << "\n";
UndoCommands(1);
cout << ans << "\n";
cout << GetLetter(2) << "\n";
TypeLetter('e');
cout << ans << "\n";
UndoCommands(1);
cout << ans << "\n";
UndoCommands(5);
cout << ans << "\n";
TypeLetter('c');
cout << ans << "\n";
cout << GetLetter(2) << "\n";
UndoCommands(2);
cout << ans << "\n";
cout << GetLetter(2) << "\n";
return 0;
}
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |