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;
char last;
string ans="";
vector<string> state(1000001);
int curr=0;
void Init() {
}
void TypeLetter(char L) {
last = L;
ans+=last;
state[curr++]=ans;
}
void UndoCommands(int U) {
//int i;
int k=state.size();
ans=state[k-U-1];
curr=k-U-1;
}
char GetLetter(int P) {
return ans[P];
}
/*
14
T a
T b
P 1
T d
U 2
U 1
P 2
T e
U 1
U 5
T c
P 2
U 2
P 2
*/
# | 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... |