race.cpp:4:1: error: 'vector' does not name a type
4 | vector <pair <int, int>> v[maxn];
| ^~~~~~
race.cpp:5:8: error: 'maxn' was not declared in this scope
5 | int sz[maxn];
| ^~~~
race.cpp:7:10: error: 'maxn' was not declared in this scope
7 | int used[maxn];
| ^~~~
race.cpp: In function 'int find_sz(int, int)':
race.cpp:12:5: error: 'sz' was not declared in this scope
12 | sz[node] = 1;
| ^~
race.cpp:14:9: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
14 | for(pair <int, int> e : v[node])
| ^~~~
| std::pair
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from race.cpp:1:
/usr/include/c++/10/bits/stl_pair.h:211:12: note: 'std::pair' declared here
211 | struct pair
| ^~~~
race.cpp:14:15: error: expected primary-expression before 'int'
14 | for(pair <int, int> e : v[node])
| ^~~
race.cpp:22:5: error: expected primary-expression before 'return'
22 | return sz[node];
| ^~~~~~
race.cpp:20:6: error: expected ';' before 'return'
20 | }
| ^
| ;
21 |
22 | return sz[node];
| ~~~~~~
race.cpp:22:5: error: expected primary-expression before 'return'
22 | return sz[node];
| ^~~~~~
race.cpp:20:6: error: expected ')' before 'return'
20 | }
| ^
| )
21 |
22 | return sz[node];
| ~~~~~~
race.cpp:14:8: note: to match this '('
14 | for(pair <int, int> e : v[node])
| ^
race.cpp: In function 'int find_centroid(int, int, int)':
race.cpp:29:9: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
29 | for(pair <int, int> e : v[node])
| ^~~~
| std::pair
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from race.cpp:1:
/usr/include/c++/10/bits/stl_pair.h:211:12: note: 'std::pair' declared here
211 | struct pair
| ^~~~
race.cpp:29:15: error: expected primary-expression before 'int'
29 | for(pair <int, int> e : v[node])
| ^~~
race.cpp:39:5: error: expected primary-expression before 'return'
39 | return node;
| ^~~~~~
race.cpp:37:6: error: expected ';' before 'return'
37 | }
| ^
| ;
38 |
39 | return node;
| ~~~~~~
race.cpp:39:5: error: expected primary-expression before 'return'
39 | return node;
| ^~~~~~
race.cpp:37:6: error: expected ')' before 'return'
37 | }
| ^
| )
38 |
39 | return node;
| ~~~~~~
race.cpp:29:8: note: to match this '('
29 | for(pair <int, int> e : v[node])
| ^
race.cpp: At global scope:
race.cpp:43:14: error: 'INF' was not declared in this scope
43 | int answer = INF;
| ^~~
race.cpp:45:10: error: 'maxn' was not declared in this scope
45 | int help[maxn];
| ^~~~
race.cpp: In function 'void dfs1(int, int, int, int, int)':
race.cpp:50:9: error: 'help' was not declared in this scope
50 | help[weight] = c;
| ^~~~
race.cpp:53:9: error: 'help' was not declared in this scope
53 | help[k - weight] = c;
| ^~~~
race.cpp:55:9: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
55 | for(pair <int, int> e : v[node])
| ^~~~
| std::pair
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from race.cpp:1:
/usr/include/c++/10/bits/stl_pair.h:211:12: note: 'std::pair' declared here
211 | struct pair
| ^~~~
race.cpp:55:15: error: expected primary-expression before 'int'
55 | for(pair <int, int> e : v[node])
| ^~~
race.cpp:63:1: error: expected primary-expression before '}' token
63 | }
| ^
race.cpp:61:6: error: expected ';' before '}' token
61 | }
| ^
| ;
62 |
63 | }
| ~
race.cpp:63:1: error: expected primary-expression before '}' token
63 | }
| ^
race.cpp:61:6: error: expected ')' before '}' token
61 | }
| ^
| )
62 |
63 | }
| ~
race.cpp:55:8: note: to match this '('
55 | for(pair <int, int> e : v[node])
| ^
race.cpp:63:1: error: expected primary-expression before '}' token
63 | }
| ^
race.cpp: In function 'void dfs2(int, int, int, int, int)':
race.cpp:68:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
68 | ans = min(ans, help[k - weight] + depth);
| ^~~
| abs
race.cpp:68:24: error: 'help' was not declared in this scope
68 | ans = min(ans, help[k - weight] + depth);
| ^~~~
race.cpp:68:15: error: 'min' was not declared in this scope; did you mean 'std::min'?
68 | ans = min(ans, help[k - weight] + depth);
| ^~~
| std::min
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from race.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: 'std::min' declared here
3474 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
race.cpp:70:9: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
70 | for(pair <int, int> e : v[node])
| ^~~~
| std::pair
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from race.cpp:1:
/usr/include/c++/10/bits/stl_pair.h:211:12: note: 'std::pair' declared here
211 | struct pair
| ^~~~
race.cpp:70:15: error: expected primary-expression before 'int'
70 | for(pair <int, int> e : v[node])
| ^~~
race.cpp:78:1: error: expected primary-expression before '}' token
78 | }
| ^
race.cpp:76:6: error: expected ';' before '}' token
76 | }
| ^
| ;
77 |
78 | }
| ~
race.cpp:78:1: error: expected primary-expression before '}' token
78 | }
| ^
race.cpp:76:6: error: expected ')' before '}' token
76 | }
| ^
| )
77 |
78 | }
| ~
race.cpp:70:8: note: to match this '('
70 | for(pair <int, int> e : v[node])
| ^
race.cpp:78:1: error: expected primary-expression before '}' token
78 | }
| ^
race.cpp: In function 'void dfs3(int, int, int, int, int)':
race.cpp:83:24: error: 'par' was not declared in this scope
83 | if (k >= weight && par != -1)
| ^~~
race.cpp:84:9: error: 'help' was not declared in this scope
84 | help[weight] = min(help[weight], depth);
| ^~~~
race.cpp:84:24: error: 'min' was not declared in this scope; did you mean 'std::min'?
84 | help[weight] = min(help[weight], depth);
| ^~~
| std::min
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from race.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: 'std::min' declared here
3474 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
race.cpp:86:10: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
86 | for (pair <int, int> e : v[node])
| ^~~~
| std::pair
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from race.cpp:1:
/usr/include/c++/10/bits/stl_pair.h:211:12: note: 'std::pair' declared here
211 | struct pair
| ^~~~
race.cpp:86:16: error: expected primary-expression before 'int'
86 | for (pair <int, int> e : v[node])
| ^~~
race.cpp:93:1: error: expected primary-expression before '}' token
93 | }
| ^
race.cpp:92:6: error: expected ';' before '}' token
92 | }
| ^
| ;
93 | }
| ~
race.cpp:93:1: error: expected primary-expression before '}' token
93 | }
| ^
race.cpp:92:6: error: expected ')' before '}' token
92 | }
| ^
| )
93 | }
| ~
race.cpp:86:9: note: to match this '('
86 | for (pair <int, int> e : v[node])
| ^
race.cpp:93:1: error: expected primary-expression before '}' token
93 | }
| ^
race.cpp: In function 'void decompose(int, int)':
race.cpp:100:30: error: too few arguments to function 'int find_sz(int, int)'
100 | int cur_sz = find_sz(node);
| ^
race.cpp:10:5: note: declared here
10 | int find_sz(int node, int parent)
| ^~~~~~~
race.cpp:104:5: error: 'used' was not declared in this scope
104 | used[centroid] = true;
| ^~~~
race.cpp:106:9: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
106 | for(pair <int , int> e : v[centroid])
| ^~~~
| std::pair
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from race.cpp:1:
/usr/include/c++/10/bits/stl_pair.h:211:12: note: 'std::pair' declared here
211 | struct pair
| ^~~~
race.cpp:106:15: error: expected primary-expression before 'int'
106 | for(pair <int , int> e : v[centroid])
| ^~~
race.cpp:114:5: error: expected primary-expression before 'for'
114 | for(pair <int , int> e : v[centroid])
| ^~~
race.cpp:112:6: error: expected ';' before 'for'
112 | }
| ^
| ;
113 |
114 | for(pair <int , int> e : v[centroid])
| ~~~
race.cpp:114:5: error: expected primary-expression before 'for'
114 | for(pair <int , int> e : v[centroid])
| ^~~
race.cpp:112:6: error: expected ')' before 'for'
112 | }
| ^
| )
113 |
114 | for(pair <int , int> e : v[centroid])
| ~~~
race.cpp:106:8: note: to match this '('
106 | for(pair <int , int> e : v[centroid])
| ^
race.cpp:114:15: error: expected primary-expression before 'int'
114 | for(pair <int , int> e : v[centroid])
| ^~~
race.cpp:124:5: error: expected primary-expression before 'for'
124 | for(pair <int , int> e : v[centroid])
| ^~~
race.cpp:122:6: error: expected ';' before 'for'
122 | }
| ^
| ;
123 |
124 | for(pair <int , int> e : v[centroid])
| ~~~
race.cpp:124:5: error: expected primary-expression before 'for'
124 | for(pair <int , int> e : v[centroid])
| ^~~
race.cpp:122:6: error: expected ')' before 'for'
122 | }
| ^
| )
123 |
124 | for(pair <int , int> e : v[centroid])
| ~~~
race.cpp:114:8: note: to match this '('
114 | for(pair <int , int> e : v[centroid])
| ^
race.cpp:124:15: error: expected primary-expression before 'int'
124 | for(pair <int , int> e : v[centroid])
| ^~~
race.cpp:131:1: error: expected primary-expression before '}' token
131 | }
| ^
race.cpp:130:6: error: expected ';' before '}' token
130 | }
| ^
| ;
131 | }
| ~
race.cpp:131:1: error: expected primary-expression before '}' token
131 | }
| ^
race.cpp:130:6: error: expected ')' before '}' token
130 | }
| ^
| )
131 | }
| ~
race.cpp:124:8: note: to match this '('
124 | for(pair <int , int> e : v[centroid])
| ^
race.cpp:131:1: error: expected primary-expression before '}' token
131 | }
| ^
race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:139:9: error: 'v' was not declared in this scope
139 | v[h[i][0]].push_back({h[i][1] , l[i]});
| ^
race.cpp:143:5: error: 'help' was not declared in this scope
143 | help[0] = 0;
| ^~~~
race.cpp:146:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
146 | if(ans > n)
| ^~~
| abs
race.cpp:149:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
149 | return ans;
| ^~~
| abs