# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
62506 | zetapi | Crayfish scrivener (IOI12_scrivener) | C++14 | 1078 ms | 8956 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 <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define itr ::iterator
typedef pair<int,int> pii;
const int MAX=2e6;
char last;
char X[MAX];
int ind,size[MAX],par[MAX];
void Init()
{
}
void TypeLetter(char L)
{
++ind;
X[ind]=L;
par[ind]=ind-1;
size[ind]=size[par[ind]]+1;
return ;
}
void UndoCommands(int U)
{
++ind;
par[ind]=ind-U-1;
size[ind]=size[par[ind]];
return ;
}
char GetLetter(int P)
{
P++;
int cur=ind;
while(cur)
{
if(size[cur]==P and X[cur]>='a' and X[cur]<='z')
return X[cur];
cur=par[cur];
}
}
/*signed main()
{
ios_base::sync_with_stdio(false);
TypeLetter('a');
TypeLetter('b');
TypeLetter('d');
UndoCommands(2);
UndoCommands(1);
cout<<GetLetter(2);
//cout<<ind<<" "<<par[ind]<<"\n";
return 0;
}*/
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... |