제출 #118628

#제출 시각아이디문제언어결과실행 시간메모리
118628sealnot123크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++14
100 / 100
623 ms87608 KiB
#ifdef LOCAL #include "grader.cpp" #endif // LOCAL #include<bits/stdc++.h> #define x first #define y second #define pb push_back #define eb emplace_back #define all(a) (a).begin(),(a).end() #define SZ(a) (int)(a).size() using namespace std; typedef long long LL; typedef pair<LL,LL> PLL; typedef pair<int,int> PII; typedef double D; typedef long double LD; const int N = 1000007; char cha[N]; int dp[20][N], lv[N], state[N], cnt; void Init() {} void TypeLetter(char L){ int i,j,k,l,a,b,c,d; int p = state[cnt]; cnt++; state[cnt] = cnt; dp[0][cnt] = p; lv[cnt] = lv[p]+1; cha[cnt] = L; for(i=1; i<20; i++) dp[i][cnt] = dp[i-1][dp[i-1][cnt]]; } void UndoCommands(int U) { int t = cnt - U; state[++cnt] = state[t]; } char GetLetter(int P) { int i,j,k,l,a,b,c,d,now; now = state[cnt]; // printf("xx%d %d\n", lv[now], P); j = lv[now] - 1 - P; for(i=19; i>=0; i--){ if(j >= (1<<i)){ j -= (1<<i); now = dp[i][now]; } } return cha[now]; } /* 14 T a T b P 1 T d U 2 U 1 P 2 T e U 1 U 5 T c P 2 U 2 P 2 */

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

scrivener.cpp: In function 'void TypeLetter(char)':
scrivener.cpp:23:11: warning: unused variable 'j' [-Wunused-variable]
     int i,j,k,l,a,b,c,d;
           ^
scrivener.cpp:23:13: warning: unused variable 'k' [-Wunused-variable]
     int i,j,k,l,a,b,c,d;
             ^
scrivener.cpp:23:15: warning: unused variable 'l' [-Wunused-variable]
     int i,j,k,l,a,b,c,d;
               ^
scrivener.cpp:23:17: warning: unused variable 'a' [-Wunused-variable]
     int i,j,k,l,a,b,c,d;
                 ^
scrivener.cpp:23:19: warning: unused variable 'b' [-Wunused-variable]
     int i,j,k,l,a,b,c,d;
                   ^
scrivener.cpp:23:21: warning: unused variable 'c' [-Wunused-variable]
     int i,j,k,l,a,b,c,d;
                     ^
scrivener.cpp:23:23: warning: unused variable 'd' [-Wunused-variable]
     int i,j,k,l,a,b,c,d;
                       ^
scrivener.cpp: In function 'char GetLetter(int)':
scrivener.cpp:39:13: warning: unused variable 'k' [-Wunused-variable]
     int i,j,k,l,a,b,c,d,now;
             ^
scrivener.cpp:39:15: warning: unused variable 'l' [-Wunused-variable]
     int i,j,k,l,a,b,c,d,now;
               ^
scrivener.cpp:39:17: warning: unused variable 'a' [-Wunused-variable]
     int i,j,k,l,a,b,c,d,now;
                 ^
scrivener.cpp:39:19: warning: unused variable 'b' [-Wunused-variable]
     int i,j,k,l,a,b,c,d,now;
                   ^
scrivener.cpp:39:21: warning: unused variable 'c' [-Wunused-variable]
     int i,j,k,l,a,b,c,d,now;
                     ^
scrivener.cpp:39:23: warning: unused variable 'd' [-Wunused-variable]
     int i,j,k,l,a,b,c,d,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...