0_0_38796334_1444.cpp:5:1: error: 'vector' does not name a type
5 | vector<node> g;
| ^~~~~~
0_0_38796334_1444.cpp:7:1: error: 'vector' does not name a type
7 | vector<Query> query;
| ^~~~~~
0_0_38796334_1444.cpp: In function 'void work()':
0_0_38796334_1444.cpp:9:5: error: 'g' was not declared in this scope
9 | g.clear();
| ^
0_0_38796334_1444.cpp:10:11: error: 'cin' was not declared in this scope
10 | if (!(cin >> n >> m >> q)) exit(0);
| ^~~
0_0_38796334_1444.cpp:10:18: error: 'n' was not declared in this scope
10 | if (!(cin >> n >> m >> q)) exit(0);
| ^
0_0_38796334_1444.cpp:10:23: error: 'm' was not declared in this scope
10 | if (!(cin >> n >> m >> q)) exit(0);
| ^
0_0_38796334_1444.cpp:10:28: error: 'q' was not declared in this scope
10 | if (!(cin >> n >> m >> q)) exit(0);
| ^
0_0_38796334_1444.cpp:10:32: error: 'exit' was not declared in this scope
10 | if (!(cin >> n >> m >> q)) exit(0);
| ^~~~
0_0_38796334_1444.cpp:1:1: note: 'exit' is defined in header '<cstdlib>'; did you forget to '#include <cstdlib>'?
+++ |+#include <cstdlib>
1 | struct node {
0_0_38796334_1444.cpp:11:35: error: 'm' was not declared in this scope
11 | for (int i = 1, u, v, w; i <= m; i++) {
| ^
0_0_38796334_1444.cpp:12:9: error: 'cin' was not declared in this scope
12 | cin >> u >> v >> w;
| ^~~
0_0_38796334_1444.cpp:15:5: error: 'query' was not declared in this scope; did you mean 'Query'?
15 | query.resize(q);
| ^~~~~
| Query
0_0_38796334_1444.cpp:15:18: error: 'q' was not declared in this scope
15 | query.resize(q);
| ^
0_0_38796334_1444.cpp:16:33: error: 'cin' was not declared in this scope
16 | for (int i = 0; i < q; i++) cin >> query[i].L, query[i].idx = i;
| ^~~
0_0_38796334_1444.cpp:18:5: error: 'sort' was not declared in this scope; did you mean 'short'?
18 | sort(g.begin(), g.end());
| ^~~~
| short
0_0_38796334_1444.cpp:20:5: error: 'DSU' has not been declared
20 | DSU::init(n);
| ^~~
0_0_38796334_1444.cpp:20:15: error: 'n' was not declared in this scope
20 | DSU::init(n);
| ^
0_0_38796334_1444.cpp:23:22: error: 'm' was not declared in this scope
23 | while (idx < m && g[idx].w <= query[i].L) {
| ^
0_0_38796334_1444.cpp:25:18: error: 'DSU' has not been declared
25 | if (!DSU::same(u, v)) {
| ^~~
0_0_38796334_1444.cpp:26:24: error: 'DSU' has not been declared
26 | ans += DSU::sz[DSU::find(u)] * DSU::sz[DSU::find(v)];
| ^~~
0_0_38796334_1444.cpp:26:32: error: 'DSU' has not been declared
26 | ans += DSU::sz[DSU::find(u)] * DSU::sz[DSU::find(v)];
| ^~~
0_0_38796334_1444.cpp:26:48: error: 'DSU' has not been declared
26 | ans += DSU::sz[DSU::find(u)] * DSU::sz[DSU::find(v)];
| ^~~
0_0_38796334_1444.cpp:26:56: error: 'DSU' has not been declared
26 | ans += DSU::sz[DSU::find(u)] * DSU::sz[DSU::find(v)];
| ^~~
0_0_38796334_1444.cpp:27:17: error: 'DSU' has not been declared
27 | DSU::merge(u, v);
| ^~~
0_0_38796334_1444.cpp:34:33: error: 'cout' was not declared in this scope
34 | for (int i = 0; i < q; i++) cout << query[i].ans << endl;
| ^~~~
0_0_38796334_1444.cpp:34:57: error: 'endl' was not declared in this scope
34 | for (int i = 0; i < q; i++) cout << query[i].ans << endl;
| ^~~~
|