plants.cpp:1:1: error: expected unqualified-id before '+' token
1 | + 1, i);
| ^
plants.cpp:2:5: error: expected unqualified-id before 'while'
2 | while (id != -1)
| ^~~~~
plants.cpp:7:5: error: 'h1' does not name a type
7 | h1[i] = c--;
| ^~
plants.cpp:8:9: error: expected constructor, destructor, or type conversion before '(' token
8 | CAdd(i - k + 1, i, -1);
| ^
plants.cpp:9:9: error: expected constructor, destructor, or type conversion before '(' token
9 | CAdd(i, i + 1, INF);
| ^
plants.cpp:10:1: error: expected declaration before '}' token
10 | }
| ^
plants.cpp:12:18: error: 'vector' has not been declared
12 | void init(int k, vector<int> r)
| ^~~~~~
plants.cpp:12:24: error: expected ',' or '...' before '<' token
12 | void init(int k, vector<int> r)
| ^
plants.cpp: In function 'void init(int, int)':
plants.cpp:14:5: error: 'n' was not declared in this scope
14 | n = r.size();
| ^
plants.cpp:14:9: error: 'r' was not declared in this scope
14 | n = r.size();
| ^
plants.cpp:15:5: error: 'vector' was not declared in this scope
15 | vector<int> h1(n);
| ^~~~~~
plants.cpp:15:12: error: expected primary-expression before 'int'
15 | vector<int> h1(n);
| ^~~
plants.cpp:16:5: error: 'c' was not declared in this scope
16 | c = n;
| ^
plants.cpp:18:5: error: 'Build' was not declared in this scope
18 | Build(0, n, 0, r);
| ^~~~~
plants.cpp:20:14: error: 'CGet' was not declared in this scope
20 | int id = CGet(0, n);
| ^~~~
plants.cpp:23:24: error: 'h1' was not declared in this scope
23 | call(id, k, r, h1);
| ^~
plants.cpp:23:9: error: 'call' was not declared in this scope
23 | call(id, k, r, h1);
| ^~~~
plants.cpp:28:9: error: 'H' was not declared in this scope
28 | H[i] = h1[i];
| ^
plants.cpp:28:16: error: 'h1' was not declared in this scope
28 | H[i] = h1[i];
| ^~
plants.cpp: In function 'int compare_plants(int, int)':
plants.cpp:36:9: error: 'H' was not declared in this scope
36 | if (H[x] > H[y]) return 1;
| ^