cave.cpp: In function 'void exploreCave(int)':
cave.cpp:6:13: error: 'n' was not declared in this scope
6 | int res[n];
| ^
cave.cpp:9:9: error: 'state' was not declared in this scope; did you mean '_xstate'?
9 | state[i] = -1;
| ^~~~~
| _xstate
cave.cpp:10:9: error: 'res' was not declared in this scope
10 | res[i] = -1;
| ^~~
cave.cpp:16:17: error: 'state' was not declared in this scope; did you mean 'onstate'?
16 | if (state[i] == -1) temp[i] = 0;
| ^~~~~
| onstate
cave.cpp:16:33: error: 'temp' was not declared in this scope; did you mean 'tm'?
16 | if (state[i] == -1) temp[i] = 0;
| ^~~~
| tm
cave.cpp:17:18: error: 'temp' was not declared in this scope; did you mean 'tm'?
17 | else temp[i] = state[i];
| ^~~~
| tm
cave.cpp:19:36: error: 'temp' was not declared in this scope; did you mean 'tm'?
19 | int block = tryCombination(temp);
| ^~~~
| tm
cave.cpp:28:21: error: expected initializer before '-' token
28 | int mid - (l + r) / 2;
| ^
cave.cpp:29:33: error: 'mid' was not declared in this scope
29 | for (int i = l;i <= mid;i++) {
| ^~~
cave.cpp:30:21: error: 'state' was not declared in this scope; did you mean 'onstate'?
30 | if (state[i] == -1) temp[i] = onstate;
| ^~~~~
| onstate
cave.cpp:35:21: error: 'mid' was not declared in this scope
35 | l = mid;
| ^~~
cave.cpp:38:21: error: 'mid' was not declared in this scope
38 | r = mid;
| ^~~
cave.cpp:41:9: error: 'state' was not declared in this scope; did you mean 'onstate'?
41 | state[l] = onstate;
| ^~~~~
| onstate
cave.cpp:42:9: error: 'res' was not declared in this scope
42 | res[i] = l;
| ^~~
cave.cpp:44:12: error: 'state' was not declared in this scope; did you mean '_xstate'?
44 | answer(state, res);
| ^~~~~
| _xstate
cave.cpp:44:19: error: 'res' was not declared in this scope
44 | answer(state, res);
| ^~~