garden.cpp: In function 'void count_routes(int, int, int, int (*)[2], int, int*)':
garden.cpp:5:5: error: 'n' was not declared in this scope
5 | n = N;
| ^
garden.cpp:6:12: error: 'mn' was not declared in this scope
6 | fill_n(mn, n, 1e8);
| ^~
garden.cpp:6:5: error: 'fill_n' was not declared in this scope
6 | fill_n(mn, n, 1e8);
| ^~~~~~
garden.cpp:9:9: error: 'help' was not declared in this scope
9 | help[a].push_back(i);
| ^~~~
garden.cpp:11:9: error: 'chkmin' was not declared in this scope
11 | chkmin(mn[a], i);
| ^~~~~~
garden.cpp:15:14: error: 'help' was not declared in this scope
15 | sort(help[i].begin(), help[i].end());
| ^~~~
garden.cpp:15:9: error: 'sort' was not declared in this scope; did you mean 'short'?
15 | sort(help[i].begin(), help[i].end());
| ^~~~
| short
garden.cpp:21:13: error: 'par' was not declared in this scope
21 | par[i] = R[best][0] + R[best][1] - i;
| ^~~
garden.cpp:33:9: error: 'g' was not declared in this scope
33 | g[par[i]].push_back(i);
| ^
garden.cpp:33:11: error: 'par' was not declared in this scope
33 | g[par[i]].push_back(i);
| ^~~
garden.cpp:36:5: error: 'cnt' was not declared in this scope; did you mean 'int'?
36 | cnt[0] = cnt[1] = -1;
| ^~~
| int
garden.cpp:37:12: error: 'used' was not declared in this scope
37 | fill_n(used, n, 0);
| ^~~~
garden.cpp:38:5: error: 'dfs' was not declared in this scope
38 | dfs(P, 0);
| ^~~
garden.cpp:40:5: error: 'cout' was not declared in this scope
40 | cout << endl;
| ^~~~
garden.cpp:40:13: error: 'endl' was not declared in this scope
40 | cout << endl;
| ^~~~
garden.cpp:47:33: error: 'MAX_N' was not declared in this scope
47 | for(int j = cnt[i]; j < MAX_N; j ++) {
| ^~~~~
garden.cpp:48:27: error: 'ans' was not declared in this scope
48 | for(auto it : ans[i][j]) {
| ^~~
garden.cpp:57:32: error: 'ans' was not declared in this scope
57 | ret += upper_bound(ans[0][G[i] % cnt[0]].begin(), ans[0][G[i] % cnt[0]].end(), G[i]) - ans[0][G[i] % cnt[0]].begin();
| ^~~
garden.cpp:57:20: error: 'upper_bound' was not declared in this scope
57 | ret += upper_bound(ans[0][G[i] % cnt[0]].begin(), ans[0][G[i] % cnt[0]].end(), G[i]) - ans[0][G[i] % cnt[0]].begin();
| ^~~~~~~~~~~
garden.cpp:59:20: error: 'ans' was not declared in this scope
59 | ret += ans[0][G[i]].size();
| ^~~
garden.cpp:63:32: error: 'ans' was not declared in this scope
63 | ret += upper_bound(ans[1][G[i] % cnt[1]].begin(), ans[1][G[i] % cnt[1]].end(), G[i]) - ans[1][G[i] % cnt[1]].begin();
| ^~~
garden.cpp:63:20: error: 'upper_bound' was not declared in this scope
63 | ret += upper_bound(ans[1][G[i] % cnt[1]].begin(), ans[1][G[i] % cnt[1]].end(), G[i]) - ans[1][G[i] % cnt[1]].begin();
| ^~~~~~~~~~~
garden.cpp:65:20: error: 'ans' was not declared in this scope
65 | ret += ans[1][G[i]].size();
| ^~~