factories.cpp:2:16: error: '__lg' was not declared in this scope
2 | const int LG = __lg(NM);
| ^~~~
factories.cpp:5:1: error: 'vector' does not name a type
5 | vector<pair<int, int>> adj[NM];
| ^~~~~~
factories.cpp:7:1: error: 'vector' does not name a type
7 | vector<int> tour;
| ^~~~~~
factories.cpp:10:1: error: 'pair' does not name a type
10 | pair<int, int> ST[LG + 2][NM << 1];
| ^~~~
factories.cpp: In function 'void dfs_euler_tour(const int&)':
factories.cpp:15:14: error: 'tour' was not declared in this scope; did you mean 'tout'?
15 | tin[u] = tour.size();
| ^~~~
| tout
factories.cpp:18:24: error: 'adj' was not declared in this scope
18 | for (auto &[v, w]: adj[u])
| ^~~
factories.cpp: In function 'void build_sparse_table()':
factories.cpp:31:25: error: 'tour' was not declared in this scope; did you mean 'tout'?
31 | for (int i = 0; i < tour.size(); ++i)
| ^~~~
| tout
factories.cpp:32:9: error: 'ST' was not declared in this scope
32 | ST[0][i] = {depth[tour[i]], tour[i]};
| ^~
factories.cpp:35:44: error: 'tour' was not declared in this scope; did you mean 'tout'?
35 | for (int j = 0; j + (1 << i) - 1 < tour.size(); ++j)
| ^~~~
| tout
factories.cpp:36:13: error: 'ST' was not declared in this scope
36 | ST[i][j] = min(ST[i - 1][j], ST[i - 1][j + (1 << (i - 1))]);
| ^~
factories.cpp:36:24: error: 'min' was not declared in this scope; did you mean 'tin'?
36 | ST[i][j] = min(ST[i - 1][j], ST[i - 1][j + (1 << (i - 1))]);
| ^~~
| tin
factories.cpp: In function 'int lca(const int&, const int&)':
factories.cpp:41:16: error: 'swap' was not declared in this scope
41 | if (l > r) swap(l, r);
| ^~~~
factories.cpp:43:13: error: '__lg' was not declared in this scope
43 | int k = __lg(r - l + 1);
| ^~~~
factories.cpp:44:16: error: 'ST' was not declared in this scope
44 | return min(ST[k][l], ST[k][r - (1 << k) + 1]).second;
| ^~
factories.cpp:44:12: error: 'min' was not declared in this scope; did you mean 'tin'?
44 | return min(ST[k][l], ST[k][r - (1 << k) + 1]).second;
| ^~~
| tin
factories.cpp: In function 'void Init(int, int*, int*, int*)':
factories.cpp:51:9: error: 'adj' was not declared in this scope
51 | adj[A[i]].emplace_back(B[i], D[i]);
| ^~~
factories.cpp: At global scope:
factories.cpp:67:1: error: 'vector' does not name a type
67 | vector<pair<int, long long>> new_adj[NM];
| ^~~~~~
factories.cpp:68:1: error: 'priority_queue' does not name a type
68 | priority_queue<pair<long long, int>> q;
| ^~~~~~~~~~~~~~
factories.cpp: In function 'long long int Query(int, int*, int, int*)':
factories.cpp:72:5: error: 'vector' was not declared in this scope
72 | vector<int> node;
| ^~~~~~
factories.cpp:72:12: error: expected primary-expression before 'int'
72 | vector<int> node;
| ^~~
factories.cpp:75:9: error: 'node' was not declared in this scope
75 | node.emplace_back(X[i]);
| ^~~~
factories.cpp:78:9: error: 'node' was not declared in this scope
78 | node.emplace_back(Y[i]);
| ^~~~
factories.cpp:80:10: error: 'node' was not declared in this scope
80 | sort(node.begin(), node.end(), cmp);
| ^~~~
factories.cpp:80:5: error: 'sort' was not declared in this scope; did you mean 'short'?
80 | sort(node.begin(), node.end(), cmp);
| ^~~~
| short
factories.cpp:81:16: error: 'unique' was not declared in this scope
81 | node.erase(unique(node.begin(), node.end()), node.end());
| ^~~~~~
factories.cpp:92:9: error: 'new_adj' was not declared in this scope
92 | new_adj[i].clear();
| ^~~~~~~
factories.cpp:99:9: error: 'q' was not declared in this scope
99 | q.push({0, X[i]});
| ^
factories.cpp:102:5: error: 'stack' was not declared in this scope
102 | stack<int> st;
| ^~~~~
factories.cpp:102:11: error: expected primary-expression before 'int'
102 | stack<int> st;
| ^~~
factories.cpp:103:5: error: 'st' was not declared in this scope; did you mean 'std'?
103 | st.push(node[0]);
| ^~
| std
factories.cpp:109:9: error: 'new_adj' was not declared in this scope
109 | new_adj[st.top()].emplace_back(node[i], dist[node[i]] - dist[st.top()]);
| ^~~~~~~
factories.cpp:115:13: error: 'q' was not declared in this scope
115 | while (!q.empty()) {
| ^
factories.cpp:122:28: error: 'new_adj' was not declared in this scope
122 | for (auto &[v, w]: new_adj[u])
| ^~~~~~~
factories.cpp:132:15: error: 'min' was not declared in this scope; did you mean 'tin'?
132 | ans = min(ans, d[Y[i]]);
| ^~~
| tin