제출 #120758

#제출 시각아이디문제언어결과실행 시간메모리
120758MAMBA크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++14
0 / 100
345 ms262144 KiB
#include <bits/stdc++.h> using namespace std; #define rep(i, j, k) for (int i = j; i < int(k); i++) constexpr int N = 1e6 + 10; struct node { node* par[20]; char c = '\0'; int deep = -1; node() { fill(par, par + 20, this); } node(char c_, node* p) { par[0] = p, c = c_; deep = p->deep + 1; rep(i, 1, 20) par[i] = par[i - 1]->par[i - 1]; } } state[N]; int now; void Init() { now = 0; } void TypeLetter(char L) { state[(++now)] = node(L, &state[now - 1]); } void UndoCommands(int U) { state[(++now)] = state[now - U - 1]; } char GetLetter(int P) { int goUp = state[now].deep - P; node* me = &state[now]; rep(i, 0, 20) if (goUp >> i & 1) me = me->par[i]; return me->c; }

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

scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:24:34: warning: operation on 'now' may be undefined [-Wsequence-point]
 void TypeLetter(char L) { state[(++now)] = node(L, &state[now - 1]); }
                                 ~^~~~~~
scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:26:35: warning: operation on 'now' may be undefined [-Wsequence-point]
 void UndoCommands(int U) { state[(++now)] = state[now - U - 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...