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;
string s;
vector<int>borr;
bool band=1;
void Init()
{
s="";
}
void TypeLetter(char L)
{
s+=L;
borr.push_back(0);
}
void UndoCommands(int U)
{
s+='0';
borr.push_back(U);
}
void arm()
{
string res="";
for(int i=int(s.size())-1; i>=0; i--)
{
if(s[i]!='0')
{
res+=s[i];
}
else
{
i-=borr[i];
}
}
s="";
for(int i=int(res.size())-1; i>=0; i--)
{
s+=res[i];
}
}
char GetLetter(int P)
{
if(band)
arm();
band=0;
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... |