Submission #503932

#TimeUsernameProblemLanguageResultExecution timeMemory
503932Abrar_Al_SamitXylophone (JOI18_xylophone)C++17
Compilation error
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]);
  }
}

Compilation message (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]);
      |     ^~~~~~