Submission #61835

#TimeUsernameProblemLanguageResultExecution timeMemory
61835theknife2001Crayfish scrivener (IOI12_scrivener)C++17
26 / 100
296 ms52716 KiB
#include <bits/stdc++.h> using namespace std; const int N=1e6+5; int a[N]; char b[N]; int c[N]; char s[N]; int cnt; int k=0; void Init() {} void TypeLetter(char L) { a[k]=1; b[k]=L; k++; } void UndoCommands(int U) { a[k]=2; c[k]=U; k++; } char GetLetter(int P) { if(cnt==0) { int j=0; k--; while(k>=0) { if(a[k]==1) { s[j]=b[k]; j++; } else if(a[k]==2) { k=k-c[k]; } else { cout<<k<<endl; assert(0); } k--; } reverse(s,s+j); } cnt=1; return s[P]; }
#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...