factories.cpp:24:1: error: 'vector' does not name a type
24 | vector<ll>Dis;
| ^~~~~~
factories.cpp:25:1: error: 'vector' does not name a type
25 | vector<int>dpth;
| ^~~~~~
factories.cpp:26:1: error: 'vector' does not name a type
26 | vector<vector<int>>BB, AA, up;
| ^~~~~~
factories.cpp: In function 'void pre()':
factories.cpp:30:5: error: 'Dis' was not declared in this scope
30 | Dis.resize(n, inf), dpth.resize(n, 2*n), AA.resize(n), BB.resize(n), up.resize(n, vector<int>(lg+1));
| ^~~
factories.cpp:30:25: error: 'dpth' was not declared in this scope
30 | Dis.resize(n, inf), dpth.resize(n, 2*n), AA.resize(n), BB.resize(n), up.resize(n, vector<int>(lg+1));
| ^~~~
factories.cpp:30:46: error: 'AA' was not declared in this scope; did you mean 'A'?
30 | Dis.resize(n, inf), dpth.resize(n, 2*n), AA.resize(n), BB.resize(n), up.resize(n, vector<int>(lg+1));
| ^~
| A
factories.cpp:30:60: error: 'BB' was not declared in this scope; did you mean 'B'?
30 | Dis.resize(n, inf), dpth.resize(n, 2*n), AA.resize(n), BB.resize(n), up.resize(n, vector<int>(lg+1));
| ^~
| B
factories.cpp:30:74: error: 'up' was not declared in this scope
30 | Dis.resize(n, inf), dpth.resize(n, 2*n), AA.resize(n), BB.resize(n), up.resize(n, vector<int>(lg+1));
| ^~
factories.cpp:30:87: error: 'vector' was not declared in this scope
30 | Dis.resize(n, inf), dpth.resize(n, 2*n), AA.resize(n), BB.resize(n), up.resize(n, vector<int>(lg+1));
| ^~~~~~
factories.cpp:1:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
+++ |+#include <vector>
1 | //#include<bits/stdc++.h>
factories.cpp:30:94: error: expected primary-expression before 'int'
30 | Dis.resize(n, inf), dpth.resize(n, 2*n), AA.resize(n), BB.resize(n), up.resize(n, vector<int>(lg+1));
| ^~~
factories.cpp: In function 'void bfs(int)':
factories.cpp:34:5: error: 'queue' was not declared in this scope
34 | queue<int>q;
| ^~~~~
factories.cpp:1:1: note: 'std::queue' is defined in header '<queue>'; did you forget to '#include <queue>'?
+++ |+#include <queue>
1 | //#include<bits/stdc++.h>
factories.cpp:34:11: error: expected primary-expression before 'int'
34 | queue<int>q;
| ^~~
factories.cpp:35:5: error: 'q' was not declared in this scope
35 | q.push(ind);
| ^
factories.cpp:36:5: error: 'up' was not declared in this scope
36 | up[ind][0]=ind;
| ^~
factories.cpp:37:5: error: 'Dis' was not declared in this scope
37 | Dis[ind]=dpth[ind]=0;
| ^~~
factories.cpp:37:14: error: 'dpth' was not declared in this scope
37 | Dis[ind]=dpth[ind]=0;
| ^~~~
factories.cpp:46:23: error: 'AA' was not declared in this scope; did you mean 'A'?
46 | for(int i=0;i<AA[u].size();i++){
| ^~
| A
factories.cpp:49:50: error: 'BB' was not declared in this scope; did you mean 'B'?
49 | dpth[v]=dpth[u]+1, Dis[v]=Dis[u]+BB[u][i];
| ^~
| B
factories.cpp: In function 'int lca(int, int)':
factories.cpp:60:8: error: 'dpth' was not declared in this scope
60 | if(dpth[u]>dpth[v])
| ^~~~
factories.cpp:61:9: error: 'swap' was not declared in this scope
61 | swap(u, v);
| ^~~~
factories.cpp:63:12: error: 'dpth' was not declared in this scope
63 | if(dpth[up[v][j]]>=dpth[u])
| ^~~~
factories.cpp:63:17: error: 'up' was not declared in this scope; did you mean 'u'?
63 | if(dpth[up[v][j]]>=dpth[u])
| ^~
| u
factories.cpp:69:12: error: 'up' was not declared in this scope; did you mean 'u'?
69 | if(up[u][j]!=up[v][j])
| ^~
| u
factories.cpp:72:12: error: 'up' was not declared in this scope; did you mean 'u'?
72 | return up[v][0];
| ^~
| u
factories.cpp: In function 'long long int get_dis(int, int)':
factories.cpp:77:12: error: 'Dis' was not declared in this scope
77 | return Dis[u]+Dis[v]-Dis[lca(u, v)];
| ^~~
factories.cpp: In function 'void Init(int, int*, int*, int*)':
factories.cpp:84:9: error: 'AA' was not declared in this scope; did you mean 'A'?
84 | AA[u].push_back(v);
| ^~
| A
factories.cpp:86:9: error: 'BB' was not declared in this scope; did you mean 'B'?
86 | BB[u].push_back(w);
| ^~
| B
factories.cpp: In function 'long long int Query(int, int*, int, int*)':
factories.cpp:96:17: error: 'min' was not declared in this scope
96 | ans=min(ans, get_dis(X[i], Y[j]));
| ^~~
factories.cpp: At global scope:
factories.cpp:20:12: warning: 'Qy' defined but not used [-Wunused-variable]
20 | static int Qy[MAX_N];
| ^~
factories.cpp:19:12: warning: 'Qx' defined but not used [-Wunused-variable]
19 | static int Qx[MAX_N];
| ^~
factories.cpp:18:12: warning: 'Y' defined but not used [-Wunused-variable]
18 | static int Y[MAX_SUM_ST];
| ^
factories.cpp:17:12: warning: 'X' defined but not used [-Wunused-variable]
17 | static int X[MAX_SUM_ST];
| ^
factories.cpp:16:12: warning: 'T' defined but not used [-Wunused-variable]
16 | static int T[MAX_N];
| ^
factories.cpp:15:12: warning: 'S' defined but not used [-Wunused-variable]
15 | static int S[MAX_N];
| ^
factories.cpp:14:32: warning: 'D' defined but not used [-Wunused-variable]
14 | static int A[MAX_N], B[MAX_N], D[MAX_N];
| ^
factories.cpp:14:22: warning: 'B' defined but not used [-Wunused-variable]
14 | static int A[MAX_N], B[MAX_N], D[MAX_N];
| ^
factories.cpp:14:12: warning: 'A' defined but not used [-Wunused-variable]
14 | static int A[MAX_N], B[MAX_N], D[MAX_N];
| ^
factories.cpp:13:15: warning: 'Q' defined but not used [-Wunused-variable]
13 | static int N, Q;
| ^
factories.cpp:13:12: warning: 'N' defined but not used [-Wunused-variable]
13 | static int N, Q;
| ^