cave.cpp:14:9: error: 'pair' does not name a type
14 | typedef pair<int, int> pii;
| ^~~~
cave.cpp:15:9: error: 'vector' does not name a type
15 | typedef vector<int> vi;
| ^~~~~~
cave.cpp:16:16: error: 'pii' was not declared in this scope
16 | typedef vector<pii> vii;
| ^~~
cave.cpp:16:16: error: 'pii' was not declared in this scope
cave.cpp:16:16: error: 'pii' was not declared in this scope
cave.cpp:16:16: error: 'pii' was not declared in this scope
cave.cpp:16:16: error: 'pii' was not declared in this scope
cave.cpp:16:16: error: 'pii' was not declared in this scope
cave.cpp:16:9: error: 'vector' does not name a type
16 | typedef vector<pii> vii;
| ^~~~~~
cave.cpp: In function 'int rec(int, int, int)':
cave.cpp:26:35: error: 'a' was not declared in this scope
26 | int m = (l + r) / 2, re = rev(a[p]);
| ^
cave.cpp:29:14: error: 'vis' was not declared in this scope
29 | if (!vis[i]) a[i] = re;
| ^~~
cave.cpp:34:45: error: 'k' was not declared in this scope
34 | for (int i = m + 1; i <= r; i++) a[i] = k;
| ^
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:39:5: error: 'n' was not declared in this scope
39 | n = N;
| ^
cave.cpp:41:37: error: 'a' was not declared in this scope
41 | for (int j = 0; j < n; j++) a[j] = 1;
| ^
cave.cpp:43:17: error: 'vis' was not declared in this scope
43 | if (vis[j]) a[j] = ans1[j];
| ^~~
cave.cpp:43:25: error: 'a' was not declared in this scope
43 | if (vis[j]) a[j] = ans1[j];
| ^
cave.cpp:43:32: error: 'ans1' was not declared in this scope
43 | if (vis[j]) a[j] = ans1[j];
| ^~~~
cave.cpp:45:32: error: 'a' was not declared in this scope
45 | int b = tryCombination(a);
| ^
cave.cpp:46:31: error: 'k' was not declared in this scope
46 | if (b > i || b == -1) k = 1;
| ^
cave.cpp:48:13: error: 'k' was not declared in this scope
48 | k = 0;
| ^
cave.cpp:50:22: error: 'vis' was not declared in this scope
50 | if (!vis[j]) a[i] = k;
| ^~~
cave.cpp:54:9: error: 'ans2' was not declared in this scope
54 | ans2[pos] = i;
| ^~~~
cave.cpp:55:9: error: 'ans1' was not declared in this scope
55 | ans1[pos] = k;
| ^~~~
cave.cpp:55:21: error: 'k' was not declared in this scope
55 | ans1[pos] = k;
| ^
cave.cpp:57:9: error: 'vis' was not declared in this scope
57 | vis[pos] = 1;
| ^~~
cave.cpp:59:13: error: 'ans1' was not declared in this scope
59 | answer (ans1, ans2);
| ^~~~
cave.cpp:59:19: error: 'ans2' was not declared in this scope
59 | answer (ans1, ans2);
| ^~~~