currencies.cpp:5:12: error: 'vector' does not name a type
5 | using vi = vector<int>;
| ^~~~~~
currencies.cpp:17:12: error: 'vi' was not declared in this scope; did you mean 'void'?
17 | vector<vi> graf;
| ^~
| void
currencies.cpp:17:12: error: 'vi' was not declared in this scope; did you mean 'void'?
17 | vector<vi> graf;
| ^~
| void
currencies.cpp:17:12: error: 'vi' was not declared in this scope; did you mean 'void'?
17 | vector<vi> graf;
| ^~
| void
currencies.cpp:17:12: error: 'vi' was not declared in this scope; did you mean 'void'?
17 | vector<vi> graf;
| ^~
| void
currencies.cpp:17:12: error: 'vi' was not declared in this scope; did you mean 'void'?
17 | vector<vi> graf;
| ^~
| void
currencies.cpp:17:12: error: 'vi' was not declared in this scope; did you mean 'void'?
17 | vector<vi> graf;
| ^~
| void
currencies.cpp:17:12: error: 'vi' was not declared in this scope; did you mean 'void'?
17 | vector<vi> graf;
| ^~
| void
currencies.cpp:17:12: error: 'vi' was not declared in this scope; did you mean 'void'?
17 | vector<vi> graf;
| ^~
| void
currencies.cpp:17:12: error: 'vi' was not declared in this scope; did you mean 'void'?
17 | vector<vi> graf;
| ^~
| void
currencies.cpp:17:12: error: 'vi' was not declared in this scope; did you mean 'void'?
17 | vector<vi> graf;
| ^~
| void
currencies.cpp:17:5: error: 'vector' does not name a type
17 | vector<vi> graf;
| ^~~~~~
currencies.cpp:18:12: error: 'vi' was not declared in this scope; did you mean 'void'?
18 | vector<vi> jump;
| ^~
| void
currencies.cpp:18:12: error: 'vi' was not declared in this scope; did you mean 'void'?
18 | vector<vi> jump;
| ^~
| void
currencies.cpp:18:12: error: 'vi' was not declared in this scope; did you mean 'void'?
18 | vector<vi> jump;
| ^~
| void
currencies.cpp:18:12: error: 'vi' was not declared in this scope; did you mean 'void'?
18 | vector<vi> jump;
| ^~
| void
currencies.cpp:18:12: error: 'vi' was not declared in this scope; did you mean 'void'?
18 | vector<vi> jump;
| ^~
| void
currencies.cpp:18:12: error: 'vi' was not declared in this scope; did you mean 'void'?
18 | vector<vi> jump;
| ^~
| void
currencies.cpp:18:12: error: 'vi' was not declared in this scope; did you mean 'void'?
18 | vector<vi> jump;
| ^~
| void
currencies.cpp:18:12: error: 'vi' was not declared in this scope; did you mean 'void'?
18 | vector<vi> jump;
| ^~
| void
currencies.cpp:18:12: error: 'vi' was not declared in this scope; did you mean 'void'?
18 | vector<vi> jump;
| ^~
| void
currencies.cpp:18:12: error: 'vi' was not declared in this scope; did you mean 'void'?
18 | vector<vi> jump;
| ^~
| void
currencies.cpp:18:5: error: 'vector' does not name a type
18 | vector<vi> jump;
| ^~~~~~
currencies.cpp:19:5: error: 'vi' does not name a type; did you mean 'void'?
19 | vi preorder;
| ^~
| void
currencies.cpp:20:5: error: 'vi' does not name a type; did you mean 'void'?
20 | vi depth;
| ^~
| void
currencies.cpp:21:5: error: 'vi' does not name a type; did you mean 'void'?
21 | vi max_pre;
| ^~
| void
currencies.cpp:23:29: error: 'vi' was not declared in this scope; did you mean 'void'?
23 | void init(int N, vector<vi> kopia_graf) {
| ^~
| void
currencies.cpp:23:29: error: 'vi' was not declared in this scope; did you mean 'void'?
23 | void init(int N, vector<vi> kopia_graf) {
| ^~
| void
currencies.cpp:23:29: error: 'vi' was not declared in this scope; did you mean 'void'?
23 | void init(int N, vector<vi> kopia_graf) {
| ^~
| void
currencies.cpp:23:29: error: 'vi' was not declared in this scope; did you mean 'void'?
23 | void init(int N, vector<vi> kopia_graf) {
| ^~
| void
currencies.cpp:23:22: error: 'vector' has not been declared
23 | void init(int N, vector<vi> kopia_graf) {
| ^~~~~~
currencies.cpp:23:28: error: expected ',' or '...' before '<' token
23 | void init(int N, vector<vi> kopia_graf) {
| ^
currencies.cpp: In member function 'void LCA::init(long long int, int)':
currencies.cpp:24:9: error: 'graf' was not declared in this scope
24 | graf = kopia_graf;
| ^~~~
currencies.cpp:24:16: error: 'kopia_graf' was not declared in this scope
24 | graf = kopia_graf;
| ^~~~~~~~~~
currencies.cpp:26:20: error: 'log2' was not declared in this scope
26 | LOG = ceil(log2(n)) + 1;
| ^~~~
currencies.cpp:26:15: error: 'ceil' was not declared in this scope
26 | LOG = ceil(log2(n)) + 1;
| ^~~~
currencies.cpp:27:9: error: 'jump' was not declared in this scope
27 | jump.assign(n, vi(LOG, 0));
| ^~~~
currencies.cpp:27:24: error: 'vi' was not declared in this scope; did you mean 'void'?
27 | jump.assign(n, vi(LOG, 0));
| ^~
| void
currencies.cpp:28:9: error: 'depth' was not declared in this scope
28 | depth.assign(n, 0);
| ^~~~~
currencies.cpp:29:9: error: 'preorder' was not declared in this scope
29 | preorder.assign(n, 0);
| ^~~~~~~~
currencies.cpp:30:9: error: 'max_pre' was not declared in this scope
30 | max_pre.assign(n, 0);
| ^~~~~~~
currencies.cpp: In member function 'void LCA::dfs(long long int, long long int)':
currencies.cpp:39:9: error: 'preorder' was not declared in this scope
39 | preorder[v] = aktpre++;
| ^~~~~~~~
currencies.cpp:40:9: error: 'max_pre' was not declared in this scope
40 | max_pre[v] = preorder[v];
| ^~~~~~~
currencies.cpp:41:9: error: 'jump' was not declared in this scope
41 | jump[v][0] = p;
| ^~~~
currencies.cpp:42:22: error: 'graf' was not declared in this scope
42 | for (int s : graf[v]) {
| ^~~~
currencies.cpp:44:17: error: 'depth' was not declared in this scope
44 | depth[s] = depth[v] + 1;
| ^~~~~
currencies.cpp: In member function 'void LCA::preprocess()':
currencies.cpp:54:17: error: 'jump' was not declared in this scope
54 | jump[v][k] = jump[jump[v][k - 1]][k - 1];
| ^~~~
currencies.cpp: In member function 'long long int LCA::lca(long long int, long long int)':
currencies.cpp:62:13: error: 'depth' was not declared in this scope
62 | if (depth[a] < depth[b]) swap(a, b);
| ^~~~~
currencies.cpp:65:17: error: 'depth' was not declared in this scope
65 | if (depth[a] - (1 << k) >= depth[b]) a = jump[a][k];
| ^~~~~
currencies.cpp:65:54: error: 'jump' was not declared in this scope
65 | if (depth[a] - (1 << k) >= depth[b]) a = jump[a][k];
| ^~~~
currencies.cpp:72:17: error: 'jump' was not declared in this scope
72 | if (jump[a][k] != jump[b][k]) {
| ^~~~
currencies.cpp:79:16: error: 'jump' was not declared in this scope
79 | return jump[a][0];
| ^~~~
currencies.cpp: At global scope:
currencies.cpp:84:1: error: 'vector' does not name a type
84 | vector<int> tree;
| ^~~~~~
currencies.cpp:85:1: error: 'vector' does not name a type
85 | vector<int> tree2;
| ^~~~~~
currencies.cpp: In function 'void add(long long int, long long int, long long int)':
currencies.cpp:93:13: error: 'tree' was not declared in this scope; did you mean 'free'?
93 | tree[l + 1] += val;
| ^~~~
| free
currencies.cpp:94:13: error: 'tree2' was not declared in this scope
94 | tree2[l + 1] ++;
| ^~~~~
currencies.cpp:97:13: error: 'tree' was not declared in this scope; did you mean 'free'?
97 | tree[r - 1] += val;
| ^~~~
| free
currencies.cpp:98:13: error: 'tree2' was not declared in this scope
98 | tree2[r - 1] ++;
| ^~~~~
currencies.cpp: In function 'pii query(long long int)':
currencies.cpp:110:16: error: 'tree' was not declared in this scope; did you mean 'free'?
110 | ans += tree[v];
| ^~~~
| free
currencies.cpp:111:17: error: 'tree2' was not declared in this scope
111 | ans2 += tree2[v];
| ^~~~~
currencies.cpp: In function 'int32_t main()':
currencies.cpp:141:12: error: 'vi' was not declared in this scope
141 | vector<vi> graf(n);
| ^~
currencies.cpp:141:5: error: 'vector' was not declared in this scope
141 | vector<vi> graf(n);
| ^~~~~~
currencies.cpp:2:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
1 | #include <iostream>
+++ |+#include <vector>
2 |
currencies.cpp:141:16: error: 'graf' was not declared in this scope
141 | vector<vi> graf(n);
| ^~~~
currencies.cpp:142:15: error: expected primary-expression before '>' token
142 | vector<pii> kra;
| ^
currencies.cpp:142:17: error: 'kra' was not declared in this scope
142 | vector<pii> kra;
| ^~~
currencies.cpp:143:7: error: expected ';' before 'ile_bramek'
143 | vi ile_bramek(n + 2, 0);
| ^~~~~~~~~~~
| ;
currencies.cpp:154:15: error: expected primary-expression before '>' token
154 | vector<zap> tab_zap;
| ^
currencies.cpp:154:17: error: 'tab_zap' was not declared in this scope
154 | vector<zap> tab_zap;
| ^~~~~~~
currencies.cpp:162:17: error: 'struct LCA' has no member named 'depth'
162 | if (lca.depth[z.a] > lca.depth[z.b]) swap(z.a, z.b);
| ^~~~~
currencies.cpp:162:34: error: 'struct LCA' has no member named 'depth'
162 | if (lca.depth[z.a] > lca.depth[z.b]) swap(z.a, z.b);
| ^~~~~
currencies.cpp:163:9: error: 'ile_bramek' was not declared in this scope
163 | ile_bramek[lca.preorder[z.b]] ++;
| ^~~~~~~~~~
currencies.cpp:163:24: error: 'struct LCA' has no member named 'preorder'
163 | ile_bramek[lca.preorder[z.b]] ++;
| ^~~~~~~~
currencies.cpp:164:24: error: 'struct LCA' has no member named 'max_pre'
164 | ile_bramek[lca.max_pre[z.b] + 1] --;
| ^~~~~~~
currencies.cpp:176:37: error: 'ile_bramek' was not declared in this scope
176 | for (int i = 1; i < n + 2; i++) ile_bramek[i] += ile_bramek[i - 1];
| ^~~~~~~~~~
currencies.cpp:190:7: error: expected ';' before 'odp'
190 | vi odp(q, -1);
| ^~~~
| ;
currencies.cpp:194:9: error: 'tree' was not declared in this scope; did you mean 'free'?
194 | tree.assign(2 * base, 0);
| ^~~~
| free
currencies.cpp:195:9: error: 'tree2' was not declared in this scope
195 | tree2.assign(2 * base, 0);
| ^~~~~
currencies.cpp:202:25: error: 'struct LCA' has no member named 'preorder'
202 | add(lca.preorder[z.b], lca.max_pre[z.b], z.s);
| ^~~~~~~~
currencies.cpp:202:44: error: 'struct LCA' has no member named 'max_pre'
202 | add(lca.preorder[z.b], lca.max_pre[z.b], z.s);
| ^~~~~~~
currencies.cpp:205:32: error: 'struct LCA' has no member named 'preorder'
205 | int prea = lca.preorder[z.a];
| ^~~~~~~~
currencies.cpp:206:32: error: 'struct LCA' has no member named 'preorder'
206 | int preb = lca.preorder[z.b];
| ^~~~~~~~
currencies.cpp:208:34: error: 'struct LCA' has no member named 'preorder'
208 | int prelca = lca.preorder[lcaa];
| ^~~~~~~~
currencies.cpp:213:25: error: 'ile_bramek' was not declared in this scope
213 | z.ile = ile_bramek[prea] + ile_bramek[preb] - 2 * ile_bramek[prelca] - (query(prea).second + query(preb).second - 2 * query(prelca).second);
| ^~~~~~~~~~
currencies.cpp:220:54: error: 'odp' was not declared in this scope
220 | if (z.koszts <= z.s && z.ile <= z.g) odp[z.idx] = z.g - z.ile;
| ^~~
currencies.cpp:221:22: error: 'odp' was not declared in this scope
221 | else odp[z.idx] = -1;
| ^~~
currencies.cpp:227:17: error: 'odp' was not declared in this scope
227 | cout << odp[i] << '\n';
| ^~~