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;
vector<pair<int, int>> op;
void Init() {
return;
}
bool completed = false;
void TypeLetter(char L) {
op.push_back({0, L});
completed = false;
}
void UndoCommands(int U) {
op.push_back({1, U});
completed = false;
}
string s;
char GetLetter(int P) {
if(completed == true){
return s[P];
}s.clear();
for(int i=(int)op.size()-1; i>=0; i--){
int typ = op[i].first;
int l = op[i].second;
if(typ == false){
s.push_back(l);
}else {
i -= l;
}
}
reverse(s.begin(), s.end());
completed = true;
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... |