plants.cpp:1:14: error: 'vector' in namespace 'std' does not name a template type
1 | static std:: vector<int> inc,dec,rank;
| ^~~~~~
plants.cpp:1:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
+++ |+#include <vector>
1 | static std:: vector<int> inc,dec,rank;
plants.cpp:5:25: error: 'std::vector' has not been declared
5 | int findMax(int k, std::vector<int> &r) {
| ^~~~~~
plants.cpp:5:31: error: expected ',' or '...' before '<' token
5 | int findMax(int k, std::vector<int> &r) {
| ^
plants.cpp: In function 'int findMax(int, int)':
plants.cpp:6:13: error: 'n' was not declared in this scope
6 | int i=2*n-1;
| ^
plants.cpp:7:12: error: 'r' was not declared in this scope
7 | while (r[i%n]!=0) {i--;}
| ^
plants.cpp:11:13: error: 'r' was not declared in this scope
11 | if (r[j%n]==0) i = j;
| ^
plants.cpp:14:30: error: 'r' was not declared in this scope
14 | for(int j=i; j>i-k; j--) r[j%n]--;
| ^
plants.cpp: At global scope:
plants.cpp:19:24: error: 'std::vector' has not been declared
19 | void init2(int k, std::vector<int> r) {
| ^~~~~~
plants.cpp:19:30: error: expected ',' or '...' before '<' token
19 | void init2(int k, std::vector<int> r) {
| ^
plants.cpp: In function 'void init2(int, int)':
plants.cpp:20:5: error: 'n' was not declared in this scope
20 | n = r.size();
| ^
plants.cpp:20:9: error: 'r' was not declared in this scope
20 | n = r.size();
| ^
plants.cpp:21:5: error: 'rank' was not declared in this scope
21 | rank.resize(n);
| ^~~~
plants.cpp: In function 'int compare_plants2(int, int)':
plants.cpp:29:9: error: 'rank' was not declared in this scope
29 | if (rank[x]>rank[y]) return 1;
| ^~~~
plants.cpp: At global scope:
plants.cpp:32:24: error: 'std::vector' has not been declared
32 | void init1(int k, std::vector<int> r) {
| ^~~~~~
plants.cpp:32:30: error: expected ',' or '...' before '<' token
32 | void init1(int k, std::vector<int> r) {
| ^
plants.cpp: In function 'void init1(int, int)':
plants.cpp:33:13: error: 'r' was not declared in this scope
33 | int n = r.size();
| ^
plants.cpp:34:5: error: 'inc' was not declared in this scope; did you mean 'int'?
34 | inc.resize(n); dec.resize(n);
| ^~~
| int
plants.cpp:34:20: error: 'dec' was not declared in this scope
34 | inc.resize(n); dec.resize(n);
| ^~~
plants.cpp: In function 'int compare_plants1(int, int)':
plants.cpp:45:14: error: 'dec' was not declared in this scope
45 | if (y <= dec[x] or x+n <= inc[y]) return 1;
| ^~~
plants.cpp:45:26: error: 'n' was not declared in this scope
45 | if (y <= dec[x] or x+n <= inc[y]) return 1;
| ^
plants.cpp:45:31: error: 'inc' was not declared in this scope; did you mean 'int'?
45 | if (y <= dec[x] or x+n <= inc[y]) return 1;
| ^~~
| int
plants.cpp: At global scope:
plants.cpp:49:23: error: 'std::vector' has not been declared
49 | void init(int k, std::vector<int> r) {
| ^~~~~~
plants.cpp:49:29: error: expected ',' or '...' before '<' token
49 | void init(int k, std::vector<int> r) {
| ^
plants.cpp: In function 'void init(int, int)':
plants.cpp:50:13: error: 'r' was not declared in this scope
50 | int n = r.size();
| ^
plants.cpp: In function 'int compare_plants2(int, int)':
plants.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
31 | }
| ^