rainbow.cpp:2:1: error: 'vector' does not name a type
2 | vector<vector<bool>> b;
| ^~~~~~
rainbow.cpp:3:1: error: 'vector' does not name a type
3 | vector<int> p;
| ^~~~~~
rainbow.cpp: In function 'void init(int, int, int, int, int, char*)':
rainbow.cpp:7:5: error: 'b' was not declared in this scope
7 | b.assign(R, vector<bool>(C, false));
| ^
rainbow.cpp:7:17: error: 'vector' was not declared in this scope
7 | b.assign(R, vector<bool>(C, false));
| ^~~~~~
rainbow.cpp:7:24: error: expected primary-expression before 'bool'
7 | b.assign(R, vector<bool>(C, false));
| ^~~~
rainbow.cpp:8:5: error: 'p' was not declared in this scope
8 | p.resize(R * C);
| ^
rainbow.cpp: In function 'int colour(int, int, int, int)':
rainbow.cpp:24:9: error: 'p' was not declared in this scope
24 | p[i * m + j] = i * m + j;
| ^
rainbow.cpp:25:5: error: 'function' was not declared in this scope; did you mean 'union'?
25 | function<int(int)> find = [&](int i) {
| ^~~~~~~~
| union
rainbow.cpp:25:14: error: expected primary-expression before 'int'
25 | function<int(int)> find = [&](int i) {
| ^~~
rainbow.cpp:28:70: error: 'b' was not declared in this scope
28 | for (int i = ar; i < br; ++i) for (int j = ac; j < bc; ++j) if (!b[i][j]) {
| ^
rainbow.cpp:30:13: error: 'p' was not declared in this scope
30 | p[find(i * m + j)] = find((i + 1) * m + j);
| ^
rainbow.cpp:30:15: error: 'find' was not declared in this scope
30 | p[find(i * m + j)] = find((i + 1) * m + j);
| ^~~~
rainbow.cpp:32:13: error: 'p' was not declared in this scope
32 | p[find(i * m + j)] = find(i * m + j + 1);
| ^
rainbow.cpp:32:15: error: 'find' was not declared in this scope
32 | p[find(i * m + j)] = find(i * m + j + 1);
| ^~~~
rainbow.cpp:35:70: error: 'b' was not declared in this scope
35 | for (int i = ar; i < br; ++i) for (int j = ac; j < bc; ++j) if (!b[i][j])
| ^
rainbow.cpp:36:16: error: 'find' was not declared in this scope
36 | ans += find(i * m + j) == i * m + j;
| ^~~~
rainbow.cpp:22:9: warning: unused variable '_' [-Wunused-variable]
22 | int _ = 0;
| ^