factories.cpp:6:1: error: 'vector' does not name a type
6 | vector<int> tour;
| ^~~~~~
factories.cpp:7:1: error: 'vector' does not name a type
7 | vector<pair<int,int>> adj[NM];
| ^~~~~~
factories.cpp: In function 'void dfs(int, int)':
factories.cpp:10:13: error: 'tour' was not declared in this scope
10 | in[u] = tour.size();
| ^~~~
factories.cpp:12:20: error: 'adj' was not declared in this scope
12 | for (auto &vv: adj[u]) {
| ^~~
factories.cpp:15:23: error: 'w' was not declared in this scope
15 | d[v] = d[u] + w;
| ^
factories.cpp: At global scope:
factories.cpp:22:16: error: '__lg' was not declared in this scope
22 | const int LG = __lg(NM) + 1;
| ^~~~
factories.cpp:24:1: error: 'pair' does not name a type
24 | pair<int,int> ST[LG][NM];
| ^~~~
factories.cpp: In function 'void build()':
factories.cpp:27:25: error: 'tour' was not declared in this scope
27 | for (int i = 0; i < tour.size(); ++i)
| ^~~~
factories.cpp:28:9: error: 'ST' was not declared in this scope
28 | ST[0][i] = {h[tour[i]], tour[i]};
| ^~
factories.cpp:30:42: error: 'tour' was not declared in this scope
30 | for (int i = 0; i + (1<<j) - 1 < tour.size(); ++i)
| ^~~~
factories.cpp:31:13: error: 'ST' was not declared in this scope
31 | ST[j][i] = min(ST[j-1][i], ST[j-1][i + (1<<(j-1))]);
| ^~
factories.cpp:31:24: error: 'min' was not declared in this scope; did you mean 'in'?
31 | ST[j][i] = min(ST[j-1][i], ST[j-1][i + (1<<(j-1))]);
| ^~~
| in
factories.cpp: In function 'int lca(int, int)':
factories.cpp:35:13: error: '__lg' was not declared in this scope
35 | int k = __lg(r - l + 1);
| ^~~~
factories.cpp:36:16: error: 'ST' was not declared in this scope
36 | return min(ST[k][l], ST[k][r - (1<<k) + 1]).second;
| ^~
factories.cpp:36:12: error: 'min' was not declared in this scope; did you mean 'in'?
36 | return min(ST[k][l], ST[k][r - (1<<k) + 1]).second;
| ^~~
| in
factories.cpp: In function 'void Init(int, int*, int*, int*)':
factories.cpp:41:9: error: 'adj' was not declared in this scope
41 | adj[A[i]].push_back({B[i], D[i]});
| ^~~