Submission #911516

#TimeUsernameProblemLanguageResultExecution timeMemory
911516Muhammad_AneeqCrayfish scrivener (IOI12_scrivener)C++17
60 / 100
1063 ms6116 KiB
#include <string> #include <algorithm> using namespace std; int const N=1e6+10; char com[N]={}; int ind[N]={}; int num=0; string g=""; bool w=1; void Init() { com[num]=' '; ind[0]=0; } void TypeLetter(char L) { num++; com[num]=L; ind[num]=num; g+=L; } void UndoCommands(int U) { w=1; ind[num+1]=ind[num-U]; com[num+1]=com[num-U]; num++; } char GetLetter(int P) { if (w) { g=""; int i=ind[num]; while (i!=0) { g+=com[i]; i=ind[i-1]; } reverse(begin(g),end(g)); w=0; } return g[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...