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;
int cnt=1;
string s;
string tr;
vector<int> vec;
void Init() {}
void TypeLetter(char L){
tr+=L;
}
void UndoCommands(int U){
tr+='0';
vec.push_back(U);
}
char GetLetter(int P){
if(cnt){
cnt=0;
while(tr.empty()==0){
char u=tr.back();
tr.pop_back();
if(u=='0'){
int x=vec.back();
vec.pop_back();
while(x--){
if(tr.back()=='0')vec.pop_back();
tr.pop_back();
}
}
else{
s+=u;
}
}
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... |