제출 #503932

#제출 시각아이디문제언어결과실행 시간메모리
503932Abrar_Al_SamitXylophone (JOI18_xylophone)C++17
컴파일 에러
0 ms0 KiB
void solve(int N) { int p = 2; while(query(p, N)==N-1) { ++p; } --p; int ans[n+1]; for(int i=1; i<=N; ++i) { if(i==p) { ans[i] = 1; } else { ans[i] = 1+query(1, p); } } for(int i=1; i<=N; ++i) { answer(i, ans[i]); } }

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

xylophone.cpp: In function 'void solve(int)':
xylophone.cpp:3:9: error: 'query' was not declared in this scope
    3 |   while(query(p, N)==N-1) {
      |         ^~~~~
xylophone.cpp:7:11: error: 'n' was not declared in this scope
    7 |   int ans[n+1];
      |           ^
xylophone.cpp:10:7: error: 'ans' was not declared in this scope
   10 |       ans[i] = 1;
      |       ^~~
xylophone.cpp:12:7: error: 'ans' was not declared in this scope
   12 |       ans[i] = 1+query(1, p);
      |       ^~~
xylophone.cpp:12:18: error: 'query' was not declared in this scope
   12 |       ans[i] = 1+query(1, p);
      |                  ^~~~~
xylophone.cpp:16:15: error: 'ans' was not declared in this scope
   16 |     answer(i, ans[i]);
      |               ^~~
xylophone.cpp:16:5: error: 'answer' was not declared in this scope
   16 |     answer(i, ans[i]);
      |     ^~~~~~