제출 #20811

#제출 시각아이디문제언어결과실행 시간메모리
20811jjwdi0크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++11
100 / 100
933 ms96352 KiB
int par[1<<20][21], size[1<<20], for_undo[1<<20], kth, Q; char a[1<<20]; void Init(){} void TypeLetter(char x) { for_undo[kth] = kth; if(kth) par[kth][0] = for_undo[kth - 1]; for(int i = 1; par[kth][i-1]; i++) par[kth][i] = par[par[kth][i-1]][i-1]; a[kth] = x, size[kth] = size[par[kth++][0]] + 1; } void UndoCommands(int x){ for_undo[kth] = for_undo[kth++ - x - 1]; } char GetLetter(int x) { int u = for_undo[kth - 1]; for(int i = 19; ~i; i--) if(size[par[u][i]] > x) u = par[u][i]; return a[u]; }

컴파일 시 표준 에러 (stderr) 메시지

scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:7:49: warning: operation on 'kth' may be undefined [-Wsequence-point]
  a[kth] = x, size[kth] = size[par[kth++][0]] + 1;
                                                 ^
scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:9:66: warning: operation on 'kth' may be undefined [-Wsequence-point]
 void UndoCommands(int x){ for_undo[kth] = for_undo[kth++ - x - 1]; }
                                                                  ^
#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...