제출 #124836

#제출 시각아이디문제언어결과실행 시간메모리
124836nxteru크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++14
100 / 100
468 ms63864 KiB
#include <bits/stdc++.h> using namespace std; int le[1000005],n,k,par[20][1000005],dp[1000005]; char re[1000005]; void Init(void){}; void TypeLetter(char c){ int v=le[n],x=c-'a'; k++; re[k]=c; par[0][k]=v; dp[k]=dp[v]+1; for(int i=0;i<19;i++)par[i+1][k]=par[i][par[i][k]]; n++; le[n]=k; } void UndoCommands(int x){ le[n+1]=le[n-x]; n++; } char GetLetter(int x){ x++; int v=le[n]; for(int i=0;i<20;i++)if((dp[v]-x)>>i&1)v=par[i][v]; return re[v]; }

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

scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:7:14: warning: unused variable 'x' [-Wunused-variable]
  int v=le[n],x=c-'a';
              ^
#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...