Submission #210278

#TimeUsernameProblemLanguageResultExecution timeMemory
210278eric_xiaoXylophone (JOI18_xylophone)C++14
Compilation error
0 ms0 KiB
#include "xylophone.h" #include<bits/stdc++.h> using namespace std; int A[100009],lf[100009],lf2[100009]; void solve(int N) { int i,j,k,mn = 1000000000; //vector<int> ck; A[1] = 0; A[2] = A[1]+query(1,2); ck.push_back(A[1]); ck.push_back(A[2]); mn = min(A[1],A[2]); for(i = 3;i <= N;i++) { lf[i] = query(i-1,i); lf2[i] = query(i-2,i); A[i] = A[i-1]+lf[i]; if(max({A[i],A[i-1],A[i-2]}) - min({A[i],A[i-1],A[i-2]}) != lf2[i]) { A[i] = A[i-1] - lf[i]; } mn = min(mn,A[i]); } int cg = 0,sm = 0; for(i = 1;i <= N;i++) { A[i] = A[i] - mn + 1; if(A[i] == 1) sm = 1; if(A[i] == N) { if(sm == 1) cg = 1; } } if(cg == 1) { for(i = 1;i <= N;i++) { A[i] = N + 1 - A[i]; } } for(i = 1;i <= N;i++) { answer(i,A[i]); } }

Compilation message (stderr)

xylophone.cpp: In function 'void solve(int)':
xylophone.cpp:11:5: error: 'ck' was not declared in this scope
     ck.push_back(A[1]);
     ^~
xylophone.cpp:11:5: note: suggested alternative: 'k'
     ck.push_back(A[1]);
     ^~
     k
xylophone.cpp:7:11: warning: unused variable 'j' [-Wunused-variable]
     int i,j,k,mn = 1000000000;
           ^
xylophone.cpp:7:13: warning: unused variable 'k' [-Wunused-variable]
     int i,j,k,mn = 1000000000;
             ^