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 pb push_back
#define F first
#define S second
#define all(v) (v).begin(),(v).end()
using namespace std;
const int mxn=1e6+5;
int k=0;
vector<pair<int,int>>vt;
char last;
char alp[30];
string s;
bool y=true;
void Init() {
char q='a';
for(int i=0;i<26;i++){
alp[i]=q;
q++;
}
}
void TypeLetter(char L) {
y=false;
int x=L-'a';
vt.pb({1,x});
}
void UndoCommands(int U) {
y=false;
vt.pb({2,U});
}
char GetLetter(int P) {
if(!y){
y=true;
s="";
int ind=vt.size()-1;
while(ind>=0){
int a=vt[ind].F,b=vt[ind].S;
if(a==1){
s+=alp[b];
ind--;
}
else{
ind=ind-b-1;
}
}
reverse(all(s));
}
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... |