제출 #7574

#제출 시각아이디문제언어결과실행 시간메모리
7574baneling100크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++98
100 / 100
504 ms127056 KiB
int NodeNum, Anc[1000001][30], OrderNum, Order[1000001], Lev[1000001]; char A[1000001]; void Init(void) { } void TypeLetter(char L) { int i; NodeNum++; A[NodeNum]=L; Anc[NodeNum][0]=Order[OrderNum]; Lev[NodeNum]=Lev[Order[OrderNum]]+1; i=1; while(Anc[Anc[NodeNum][i-1]][i-1]) { Anc[NodeNum][i]=Anc[Anc[NodeNum][i-1]][i-1]; i++; } OrderNum++; Order[OrderNum]=NodeNum; } void UndoCommands(int U) { OrderNum++; Order[OrderNum]=Order[OrderNum-U-1]; } char GetLetter(int P) { int N, Now, Cnt=0; N=Lev[Order[OrderNum]]-P-1; Now=Order[OrderNum]; while(N) { if(N&1) Now=Anc[Now][Cnt]; Cnt++; N>>=1; } return A[Now]; }
#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...