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>
//#include"grader.cpp"
#define fr first
#define sc second
using namespace std;
bool need_compile;
char res[1000005];
vector<pair<bool,int>>op;
void compile(){
stack<int>cur;
for(int i=op.size()-1;i>=0;i--){
auto to=op[i];
if(to.fr)i-=to.sc;
else cur.push(to.sc);
}
int sz=0;
while(!cur.empty()){
res[sz++]=cur.top();
cur.pop();
}
}
void Init(){}
void TypeLetter(char val){
need_compile=1;
op.push_back({0,int(val)});
}
void UndoCommands(int num){
need_compile=1;
op.push_back({1,num});
}
char GetLetter(int pos){
if(need_compile)compile();
return res[pos];
}
# | 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... |