Joi.cpp:3:33: error: 'std::vector' has not been declared
3 | void dfs(int v, int& t, int mp, std::vector<int>& tin, std::vector<int>& used, std::vector<int>& p, const std::vector<std::vector<int>>& g, std::vector<std::vector<int>>& childs, std::vector<int>& sz) {
| ^~~
Joi.cpp:3:44: error: expected ',' or '...' before '<' token
3 | void dfs(int v, int& t, int mp, std::vector<int>& tin, std::vector<int>& used, std::vector<int>& p, const std::vector<std::vector<int>>& g, std::vector<std::vector<int>>& childs, std::vector<int>& sz) {
| ^
Joi.cpp: In function 'void dfs(int, int&, int, int)':
Joi.cpp:4:5: error: 'tin' was not declared in this scope
4 | tin[v] = t++;
| ^~~
Joi.cpp:5:5: error: 'p' was not declared in this scope
5 | p[v] = mp;
| ^
Joi.cpp:6:5: error: 'sz' was not declared in this scope
6 | sz[v] = 1;
| ^~
Joi.cpp:7:14: error: 'BITS' was not declared in this scope
7 | if (t >= BITS) {
| ^~~~
Joi.cpp:10:5: error: 'used' was not declared in this scope
10 | used[v] = 1;
| ^~~~
Joi.cpp:11:20: error: 'g' was not declared in this scope
11 | for (auto& u : g[v]) {
| ^
Joi.cpp:13:13: error: 'childs' was not declared in this scope
13 | childs[v].push_back(u);
| ^~~~~~
Joi.cpp: In function 'void Joi(int, int, int*, int*, long long int, int)':
Joi.cpp:21:10: error: 'vector' is not a member of 'std'
21 | std::vector<std::vector<int>> g(N);
| ^~~~~~
Joi.cpp:2:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
1 | #include "Joi.h"
+++ |+#include <vector>
2 |
Joi.cpp:21:22: error: 'vector' is not a member of 'std'
21 | std::vector<std::vector<int>> g(N);
| ^~~~~~
Joi.cpp:21:22: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
Joi.cpp:21:29: error: expected primary-expression before 'int'
21 | std::vector<std::vector<int>> g(N);
| ^~~
Joi.cpp:23:9: error: 'g' was not declared in this scope
23 | g[A[i]].push_back(B[i]);
| ^
Joi.cpp:26:10: error: 'vector' is not a member of 'std'
26 | std::vector<int> tin(N), used(N), p(N), sz(N);
| ^~~~~~
Joi.cpp:26:10: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
Joi.cpp:26:17: error: expected primary-expression before 'int'
26 | std::vector<int> tin(N), used(N), p(N), sz(N);
| ^~~
Joi.cpp:28:10: error: 'vector' is not a member of 'std'
28 | std::vector<std::vector<int>> childs(N);
| ^~~~~~
Joi.cpp:28:10: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
Joi.cpp:28:22: error: 'vector' is not a member of 'std'
28 | std::vector<std::vector<int>> childs(N);
| ^~~~~~
Joi.cpp:28:22: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
Joi.cpp:28:29: error: expected primary-expression before 'int'
28 | std::vector<std::vector<int>> childs(N);
| ^~~
Joi.cpp:29:18: error: 'tin' was not declared in this scope
29 | dfs(0, t, 0, tin, used, p, g, childs, sz);
| ^~~
Joi.cpp:29:23: error: 'used' was not declared in this scope
29 | dfs(0, t, 0, tin, used, p, g, childs, sz);
| ^~~~
Joi.cpp:29:29: error: 'p' was not declared in this scope
29 | dfs(0, t, 0, tin, used, p, g, childs, sz);
| ^
Joi.cpp:29:32: error: 'g' was not declared in this scope
29 | dfs(0, t, 0, tin, used, p, g, childs, sz);
| ^
Joi.cpp:29:35: error: 'childs' was not declared in this scope
29 | dfs(0, t, 0, tin, used, p, g, childs, sz);
| ^~~~~~
Joi.cpp:29:43: error: 'sz' was not declared in this scope
29 | dfs(0, t, 0, tin, used, p, g, childs, sz);
| ^~
Ioi.cpp:8:33: error: 'std::vector' has not been declared
8 | void dfs(int v, int& t, int mp, std::vector<int>& tin, std::vector<int>& used, std::vector<int>& p, const std::vector<std::vector<int>>& g, std::vector<std::vector<int>>& childs, std::vector<int>& sz) {
| ^~~
Ioi.cpp:8:44: error: expected ',' or '...' before '<' token
8 | void dfs(int v, int& t, int mp, std::vector<int>& tin, std::vector<int>& used, std::vector<int>& p, const std::vector<std::vector<int>>& g, std::vector<std::vector<int>>& childs, std::vector<int>& sz) {
| ^
Ioi.cpp: In function 'void dfs(int, int&, int, int)':
Ioi.cpp:9:5: error: 'tin' was not declared in this scope
9 | tin[v] = t++;
| ^~~
Ioi.cpp:10:5: error: 'p' was not declared in this scope
10 | p[v] = mp;
| ^
Ioi.cpp:11:5: error: 'sz' was not declared in this scope
11 | sz[v] = 1;
| ^~
Ioi.cpp:15:5: error: 'used' was not declared in this scope
15 | used[v] = 1;
| ^~~~
Ioi.cpp:16:20: error: 'g' was not declared in this scope
16 | for (auto& u : g[v]) {
| ^
Ioi.cpp:18:13: error: 'childs' was not declared in this scope
18 | childs[v].push_back(u);
| ^~~~~~
Ioi.cpp: At global scope:
Ioi.cpp:25:64: error: 'vector' in namespace 'std' does not name a template type
25 | void dfs_down(int v, long long val, long long& ans, const std::vector<std::vector<int>>& childs, std::vector<int>& getted, const std::vector<int>& tin) {
| ^~~~~~
Ioi.cpp:2:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
1 | #include "Ioi.h"
+++ |+#include <vector>
2 |
Ioi.cpp:25:70: error: expected ',' or '...' before '<' token
25 | void dfs_down(int v, long long val, long long& ans, const std::vector<std::vector<int>>& childs, std::vector<int>& getted, const std::vector<int>& tin) {
| ^
Ioi.cpp: In function 'void dfs_down(int, long long int, long long int&, int)':
Ioi.cpp:26:5: error: 'getted' was not declared in this scope
26 | getted[tin[v]] += 1;
| ^~~~~~
Ioi.cpp:26:12: error: 'tin' was not declared in this scope
26 | getted[tin[v]] += 1;
| ^~~
Ioi.cpp:29:20: error: 'childs' was not declared in this scope
29 | for (auto& u : childs[v]) {
| ^~~~~~
Ioi.cpp: At global scope:
Ioi.cpp:38:26: error: 'std::vector' has not been declared
38 | void dfs2(int v, int& t, std::vector<int>& tin, std::vector<int>& tout, const std::vector<std::vector<int>>& childs) {
| ^~~
Ioi.cpp:38:37: error: expected ',' or '...' before '<' token
38 | void dfs2(int v, int& t, std::vector<int>& tin, std::vector<int>& tout, const std::vector<std::vector<int>>& childs) {
| ^
Ioi.cpp: In function 'void dfs2(int, int&, int)':
Ioi.cpp:39:5: error: 'tin' was not declared in this scope
39 | tin[v] = t++;
| ^~~
Ioi.cpp:40:20: error: 'childs' was not declared in this scope
40 | for (auto& u : childs[v]) {
| ^~~~~~
Ioi.cpp:41:25: error: 'tout' was not declared in this scope
41 | dfs2(u, t, tin, tout, childs);
| ^~~~
Ioi.cpp:43:5: error: 'tout' was not declared in this scope
43 | tout[v] = t - 1;
| ^~~~
Ioi.cpp: At global scope:
Ioi.cpp:46:95: error: 'vector' in namespace 'std' does not name a template type
46 | void dfs_twice(int v, long long val, long long& ans, int l, int r, int ql, int qr, const std::vector<std::vector<int>>& childs, const std::vector<int>& tin2, const std::vector<int>& tout2, const std::vector<int>& tin, std::vector<int>& getted) {
| ^~~~~~
Ioi.cpp:46:90: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
46 | void dfs_twice(int v, long long val, long long& ans, int l, int r, int ql, int qr, const std::vector<std::vector<int>>& childs, const std::vector<int>& tin2, const std::vector<int>& tout2, const std::vector<int>& tin, std::vector<int>& getted) {
| ^~~
Ioi.cpp:46:101: error: expected ',' or '...' before '<' token
46 | void dfs_twice(int v, long long val, long long& ans, int l, int r, int ql, int qr, const std::vector<std::vector<int>>& childs, const std::vector<int>& tin2, const std::vector<int>& tout2, const std::vector<int>& tin, std::vector<int>& getted) {
| ^
Ioi.cpp: In function 'void dfs_twice(int, long long int, long long int&, int, int, int, int, int)':
Ioi.cpp:47:19: error: 'tin' was not declared in this scope
47 | ans += val << tin[v];
| ^~~
Ioi.cpp:48:5: error: 'getted' was not declared in this scope
48 | getted[tin2[v]] += 1;
| ^~~~~~
Ioi.cpp:48:12: error: 'tin2' was not declared in this scope
48 | getted[tin2[v]] += 1;
| ^~~~
Ioi.cpp:49:20: error: 'childs' was not declared in this scope
49 | for (auto& u : childs[v]) {
| ^~~~~~
Ioi.cpp:54:26: error: 'qqr' was not declared in this scope; did you mean 'qql'?
54 | if ((l <= qql && qqr <= r) || (l <= qql + BITS && qqr + BITS <= r)) {
| ^~~
| qql
Ioi.cpp:58:47: error: 'qqr' was not declared in this scope; did you mean 'qql'?
58 | dfs_twice(u, new_val, ans, l, r, qql, qqr, childs, tin2, tout2, tin, getted);
| ^~~
| qql
Ioi.cpp:58:66: error: 'tout2' was not declared in this scope
58 | dfs_twice(u, new_val, ans, l, r, qql, qqr, childs, tin2, tout2, tin, getted);
| ^~~~~
Ioi.cpp: At global scope:
Ioi.cpp:63:94: error: 'vector' in namespace 'std' does not name a template type
63 | void dfs_once(int v, long long val, long long& ans, int l, int r, int ql, int qr, const std::vector<std::vector<int>>& childs, const std::vector<int>& tin2, const std::vector<int>& tout2, const std::vector<int>& tin, std::vector<int>& getted) {
| ^~~~~~
Ioi.cpp:63:89: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
63 | void dfs_once(int v, long long val, long long& ans, int l, int r, int ql, int qr, const std::vector<std::vector<int>>& childs, const std::vector<int>& tin2, const std::vector<int>& tout2, const std::vector<int>& tin, std::vector<int>& getted) {
| ^~~
Ioi.cpp:63:100: error: expected ',' or '...' before '<' token
63 | void dfs_once(int v, long long val, long long& ans, int l, int r, int ql, int qr, const std::vector<std::vector<int>>& childs, const std::vector<int>& tin2, const std::vector<int>& tout2, const std::vector<int>& tin, std::vector<int>& getted) {
| ^
Ioi.cpp: In function 'void dfs_once(int, long long int, long long int&, int, int, int, int, int)':
Ioi.cpp:64:9: error: 'getted' was not declared in this scope
64 | if (getted[tin2[v]] == 0) {
| ^~~~~~
Ioi.cpp:64:16: error: 'tin2' was not declared in this scope
64 | if (getted[tin2[v]] == 0) {
| ^~~~
Ioi.cpp:65:23: error: 'tin' was not declared in this scope
65 | ans += val << tin[v];
| ^~~
Ioi.cpp:69:20: error: 'childs' was not declared in this scope
69 | for (auto& u : childs[v]) {
| ^~~~~~
Ioi.cpp:70:19: error: 'tin2' was not declared in this scope
70 | int qql = tin2[u], qqr = std::min(tout2[u], qr);
| ^~~~
Ioi.cpp:74:26: error: 'qqr' was not declared in this scope; did you mean 'qql'?
74 | if ((l <= qql && qqr <= r) || (l <= qql + BITS && qqr + BITS <= r)) {
| ^~~
| qql
Ioi.cpp:77:30: error: 'qqr' was not declared in this scope; did you mean 'qql'?
77 | if ((qql <= r && r < qqr) || (qql + BITS <= r && r < qqr + BITS)) {
| ^~~
| qql
Ioi.cpp:81:68: error: 'tout2' was not declared in this scope
81 | dfs_twice(u, new_val, ans, l, r, ql, qr, childs, tin2, tout2, tin, getted);
| ^~~~~
Ioi.cpp:81:75: error: 'tin' was not declared in this scope
81 | dfs_twice(u, new_val, ans, l, r, ql, qr, childs, tin2, tout2, tin, getted);
| ^~~
Ioi.cpp:81:80: error: 'getted' was not declared in this scope
81 | dfs_twice(u, new_val, ans, l, r, ql, qr, childs, tin2, tout2, tin, getted);
| ^~~~~~
Ioi.cpp:88:19: error: 'tin2' was not declared in this scope
88 | int qql = tin2[u], qqr = std::min(tout2[u], qr);
| ^~~~
Ioi.cpp:89:46: error: 'qqr' was not declared in this scope; did you mean 'qql'?
89 | dfs_once(u, new_val, ans, l, r, qql, qqr, childs, tin2, tout2, tin, getted);
| ^~~
| qql
Ioi.cpp:89:51: error: 'childs' was not declared in this scope
89 | dfs_once(u, new_val, ans, l, r, qql, qqr, childs, tin2, tout2, tin, getted);
| ^~~~~~
Ioi.cpp:89:65: error: 'tout2' was not declared in this scope
89 | dfs_once(u, new_val, ans, l, r, qql, qqr, childs, tin2, tout2, tin, getted);
| ^~~~~
Ioi.cpp:89:72: error: 'tin' was not declared in this scope
89 | dfs_once(u, new_val, ans, l, r, qql, qqr, childs, tin2, tout2, tin, getted);
| ^~~
Ioi.cpp:89:77: error: 'getted' was not declared in this scope
89 | dfs_once(u, new_val, ans, l, r, qql, qqr, childs, tin2, tout2, tin, getted);
| ^~~~~~
Ioi.cpp: At global scope:
Ioi.cpp:93:38: error: 'vector' in namespace 'std' does not name a template type
93 | void get_h(int v, int qr, const std::vector<std::vector<int>>& childs, std::vector<int>& h, std::vector<int>& tin2) {
| ^~~~~~
Ioi.cpp:93:33: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
93 | void get_h(int v, int qr, const std::vector<std::vector<int>>& childs, std::vector<int>& h, std::vector<int>& tin2) {
| ^~~
Ioi.cpp:93:44: error: expected ',' or '...' before '<' token
93 | void get_h(int v, int qr, const std::vector<std::vector<int>>& childs, std::vector<int>& h, std::vector<int>& tin2) {
| ^
Ioi.cpp: In function 'void get_h(int, int, int)':
Ioi.cpp:94:5: error: 'h' was not declared in this scope
94 | h[v] = 0;
| ^
Ioi.cpp:95:20: error: 'childs' was not declared in this scope
95 | for (auto& u : childs[v]) {
| ^~~~~~
Ioi.cpp:96:13: error: 'tin2' was not declared in this scope
96 | if (tin2[u] > qr) {
| ^~~~
Ioi.cpp:99:33: error: 'tin2' was not declared in this scope
99 | get_h(u, qr, childs, h, tin2);
| ^~~~
Ioi.cpp:100:21: error: 'max' is not a member of 'std'
100 | h[v] = std::max(h[v], h[u] + 1);
| ^~~
Ioi.cpp: At global scope:
Ioi.cpp:104:31: error: 'vector' in namespace 'std' does not name a template type
104 | int get_str(int v, const std::vector<std::vector<int>>& childs, const std::vector<int>& sz, const std::vector<int>& p, std::vector<int>& h) {
| ^~~~~~
Ioi.cpp:104:26: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
104 | int get_str(int v, const std::vector<std::vector<int>>& childs, const std::vector<int>& sz, const std::vector<int>& p, std::vector<int>& h) {
| ^~~
Ioi.cpp:104:37: error: expected ',' or '...' before '<' token
104 | int get_str(int v, const std::vector<std::vector<int>>& childs, const std::vector<int>& sz, const std::vector<int>& p, std::vector<int>& h) {
| ^
Ioi.cpp: In function 'int get_str(int, int)':
Ioi.cpp:106:12: error: 'sz' was not declared in this scope
106 | while (sz[v] < BITS) {
| ^~
Ioi.cpp:108:13: error: 'p' was not declared in this scope
108 | v = p[v];
| ^
Ioi.cpp:114:10: error: 'vector' is not a member of 'std'
114 | std::vector<int> tin2(h.size()), tout2(h.size());
| ^~~~~~
Ioi.cpp:114:10: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
Ioi.cpp:114:17: error: expected primary-expression before 'int'
114 | std::vector<int> tin2(h.size()), tout2(h.size());
| ^~~
Ioi.cpp:116:16: error: 'tin2' was not declared in this scope
116 | dfs2(v, t, tin2, tout2, childs);
| ^~~~
Ioi.cpp:116:22: error: 'tout2' was not declared in this scope
116 | dfs2(v, t, tin2, tout2, childs);
| ^~~~~
Ioi.cpp:116:29: error: 'childs' was not declared in this scope
116 | dfs2(v, t, tin2, tout2, childs);
| ^~~~~~
Ioi.cpp:117:42: error: 'h' was not declared in this scope
117 | get_h(v, tin2[v] + BITS - 1, childs, h, tin2);
| ^
Ioi.cpp: At global scope:
Ioi.cpp:125:60: error: 'std::v' has not been declared
125 | void dfs_ans(int v, int qr, long long val, long long& ans, std::v ector<int>& h, std::vector<int>& tin2, std::vector<int>& getted, const std::vector<std::vector<int>>& childs) {
| ^~~
Ioi.cpp:125:72: error: expected ',' or '...' before '<' token
125 | void dfs_ans(int v, int qr, long long val, long long& ans, std::v ector<int>& h, std::vector<int>& tin2, std::vector<int>& getted, const std::vector<std::vector<int>>& childs) {
| ^
Ioi.cpp: In function 'void dfs_ans(int, int, long long int, long long int&, int)':
Ioi.cpp:126:19: error: 'tin2' was not declared in this scope
126 | ans += val << tin2[v] % BITS;
| ^~~~
Ioi.cpp:128:20: error: 'childs' was not declared in this scope
128 | for (auto& u : childs[v]) {
| ^~~~~~
Ioi.cpp:132:13: error: 'h' was not declared in this scope
132 | if (h[u] == h[v] - 1 && last == -1) {
| ^
Ioi.cpp:136:51: error: 'getted' was not declared in this scope
136 | dfs_ans(u, qr, new_val, ans, h, tin2, getted, childs);
| ^~~~~~
Ioi.cpp:142:41: error: 'h' was not declared in this scope
142 | dfs_ans(last, qr, new_val, ans, h, tin2, getted, childs);
| ^
Ioi.cpp:142:50: error: 'getted' was not declared in this scope
142 | dfs_ans(last, qr, new_val, ans, h, tin2, getted, childs);
| ^~~~~~
Ioi.cpp:142:58: error: 'childs' was not declared in this scope
142 | dfs_ans(last, qr, new_val, ans, h, tin2, getted, childs);
| ^~~~~~
Ioi.cpp: In function 'long long int Ioi(int, int, int*, int*, int, int, int)':
Ioi.cpp:147:10: error: 'vector' is not a member of 'std'
147 | std::vector<std::vector<int>> g(N);
| ^~~~~~
Ioi.cpp:147:10: note: 'std::ve