이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
string ss;
int cev,koy,say,flag,last=-1;
vector< pair<int,int> > v;
void Init(){
}
void TypeLetter(char L){
v.pb(mp(say++,L-'a'));
ss+=L;
}
void UndoCommands(int U){
v.pb(mp(U,-1));
flag=1;
}
char GetLetter(int P){
string s{};
if(flag==1){
last=(int)v.size();
reverse(v.begin(),v.end());
int ban=0;
//~ cout<<v.size()<<endl;
for(int i=0;i<(int)v.size();i++){
//~ cout<<ban<<"()"<<endl;
if(ban>0){ban--;continue;}
//~ cout<<i<<"**"<<endl;
if(v[i].se==-1)ban=v[i].fi;
else s+=v[i].se+'a';
}
reverse(v.begin(),v.end());
//~ v.clear();
reverse(s.begin(),s.end());
ss=s;
flag=0;
//~ flag=1;
}
//~ flag++;
//~ cout<<s.size()<<endl;
//~ if((int)s.size()<=P){return -1;}
return ss[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... |