제출 #310889

#제출 시각아이디문제언어결과실행 시간메모리
310889juggernaut크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++14
5 / 100
390 ms51704 KiB
#include<bits/stdc++.h> using namespace std; int up[1000005][20],depth[1000005],pos[1000005],timer,tmp,v,i; char res[1000005]; void Init(){} void TypeLetter(char ch){ res[++v]=ch; up[v][0]=tmp; depth[v]=depth[tmp]+1; tmp=v; pos[++timer]=tmp; for(i=1;i<20;i++)up[tmp][i]=up[up[tmp][i-1]][i-1]; } void UndoCommands(int num){ pos[++timer]=tmp=pos[timer-1-num]; } char GetLetter(int p){ p++; int to=tmp; for(i=19;i>=0;i--)if(depth[up[to][i]]>=p)to=up[to][i]; return res[to]; }

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

scrivener.cpp: In function 'void UndoCommands(int)':
scrivener.cpp:15:9: warning: operation on 'timer' may be undefined [-Wsequence-point]
   15 |     pos[++timer]=tmp=pos[timer-1-num];
      |         ^~~~~~~
scrivener.cpp:15:9: warning: operation on 'timer' may be undefined [-Wsequence-point]
#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...