제출 #911507

#제출 시각아이디문제언어결과실행 시간메모리
911507Muhammad_Aneeq크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
60 / 100
1101 ms16604 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; w=1; } 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) { 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...