Submission #911517

#TimeUsernameProblemLanguageResultExecution timeMemory
911517Sir_Ahmed_ImranCrayfish scrivener (IOI12_scrivener)C++17
0 / 100
994 ms137908 KiB
///~~~LOTA~~~/// #include <bits/stdc++.h> using namespace std; #define nl '\n' #define ff first #define ss second #define ll long long #define append push_back #define all(x) (x).begin(),(x).end() #define pii pair<int,int> #define N 1000001 int c; struct node{ int ind; char val; node* par[20]; }; node* x[N]; void Init(){ c=0; x[0]=new node(); x[0]->ind=-1; for(int i=0;i<20;i++) x[0]->par[i]=x[0]; } void TypeLetter(char L){ c++; x[c]=new node(); x[c]->ind=x[c-1]->ind+1; x[c]->par[0]=x[c-1]; x[c]->val=L; for(int i=0;i<19;i++) x[c]->par[i+1]=(x[c]->par[i])->par[i]; } void UndoCommands(int U){ c++; x[c]=new node; x[c]->par[0]=x[c-U-1]; x[c]->ind=x[c]->par[0]->ind; for(int i=0;i<19;i++) x[c]->par[i+1]=x[c]->par[i]->par[i]; } char GetLetter(int P){ node* n=x[c]; for(int i=19;i>=0;i--){ if(n->par[i]->ind>=P){ cout<<i<<' '<<n->par[i]->ind<<nl; n=n->par[i]; } } return n->val; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...