Submission #1105144

#TimeUsernameProblemLanguageResultExecution timeMemory
1105144jadai007Cave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
#include "cave.h" #include<bits/stdc++.h> using namespace std; void exploreCave(int N) { int state[MAX_N] = {0}, link[MAX_N] = {0}, inv[MAX_N] = {0}; for(int i = 0; i < N; ++i){ int ft = tryCombination(state); state[i] = 1; int nd = tryCombination(state); if(ft == -1){ state[i] = 0; break; } else if(nd == -1) break; else if(ft != nd) state[i] = 0; } for(int i = 0; i < N; ++i){ state[i] = !state[i]; int ck = tryCombination(state); link[i] = ck; state[i] = !state[i]; } answer(state, link); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:7:15: error: 'MAX_N' was not declared in this scope
    7 |     int state[MAX_N] = {0}, link[MAX_N] = {0}, inv[MAX_N] = {0};
      |               ^~~~~
cave.cpp:9:27: error: 'state' was not declared in this scope; did you mean '_xstate'?
    9 |   int ft = tryCombination(state);
      |                           ^~~~~
      |                           _xstate
cave.cpp:20:3: error: 'state' was not declared in this scope; did you mean '_xstate'?
   20 |   state[i] = !state[i];
      |   ^~~~~
      |   _xstate
cave.cpp:22:3: error: 'link' was not declared in this scope
   22 |   link[i] = ck;
      |   ^~~~
cave.cpp:25:9: error: 'state' was not declared in this scope; did you mean '_xstate'?
   25 |  answer(state, link);
      |         ^~~~~
      |         _xstate
cave.cpp:25:16: error: 'link' was not declared in this scope
   25 |  answer(state, link);
      |                ^~~~