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>
#define f first
#define s second
using namespace std;
string s;
vector<pair<int, pair<char, int> > > op;
void Init() {
s="!";
op.clear();
}
void TypeLetter(char L) {
op.push_back({1, {L, 0}});
}
void UndoCommands(int U) {
op.push_back({2, {' ', U}});
}
char GetLetter(int P) {
if (s=="!"){
s="";
for (int i=op.size()-1; i>=0; i--){
if (op[i].f==1) s+=op[i].s.f;
else i-=op[i].s.s;
}
reverse(s.begin(), s.end());
}
return s[P];
}
# | 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... |