# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
357166 | daniel920712 | Crayfish scrivener (IOI12_scrivener) | C++14 | 256 ms | 14416 KiB |
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 <stack>
#include <vector>
using namespace std;
char last;
int con[1000005]={0};
int now=0;
int how=0;
int ok=0;
stack < char > ans;
vector < char > tt;
vector < pair < int , int > > all;
void Init()
{
}
void TypeLetter(char L)
{
all.push_back(make_pair(1,L));
now++;
}
void UndoCommands(int U)
{
all.push_back(make_pair(2,U));
now++;
}
char GetLetter(int P)
{
int t,i;
if(now<=5000||ok==0)
{
ok=1;
how=0;
tt.clear();
for(i=now-1;i>=0;i--)
{
if(how)
{
how--;
continue;
}
if(all[i].first==1) ans.push(all[i].second);
else how+=all[i].second;
}
while(!ans.empty())
{
tt.push_back(ans.top());
ans.pop();
}
}
return tt[P];
}
Compilation message (stderr)
# | 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... |