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;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
char c;
//~ map<int,string> mpp;
int cev,koy,say,flag;
string s;
vector< pair<int,int> > v;
void Init(){
}
void TypeLetter(char L){
v.pb(mp(say++,L-'a'));
}
void UndoCommands(int U){
v.pb(mp(U,-1));
}
char GetLetter(int P){
if(flag==0){
reverse(v.begin(),v.end());
int ban=0;
for(int i=0;i<(int)v.size();i++){
if(ban){ban--;i++;continue;}
if(v[i].se==-1)ban=v[i].fi-1;
else s+=v[i].se+'a';
}
reverse(s.begin(),s.end());
flag=1;
}
//~ if((int)s.size()<=P){return -1;}
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... |