dreaming.cpp:4:1: error: 'vector' does not name a type
4 | vector<int> to, sz;
| ^~~~~~
dreaming.cpp: In function 'void unite(int, int)':
dreaming.cpp:8:13: error: 'find' was not declared in this scope; did you mean 'std::find'?
8 | int x = find(u);
| ^~~~
| std::find
In file included from /usr/include/c++/10/algorithm:74,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from dreaming.cpp:2:
/usr/include/c++/10/pstl/glue_algorithm_defs.h:60:1: note: 'std::find' declared here
60 | find(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
| ^~~~
dreaming.cpp:12:9: error: 'sz' was not declared in this scope
12 | if (sz[x] < sz[y])swap(x, y);
| ^~
dreaming.cpp:12:23: error: 'swap' was not declared in this scope
12 | if (sz[x] < sz[y])swap(x, y);
| ^~~~
dreaming.cpp:12:23: note: suggested alternatives:
In file included from /usr/include/c++/10/regex:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110,
from dreaming.cpp:2:
/usr/include/c++/10/bits/regex.h:2141:5: note: 'std::__cxx11::swap'
2141 | swap(match_results<_Bi_iter, _Alloc>& __lhs,
| ^~~~
In file included from /usr/include/c++/10/bits/stl_pair.h:59,
from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/bits/specfun.h:45,
from /usr/include/c++/10/cmath:1927,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
from dreaming.cpp:2:
/usr/include/c++/10/bits/move.h:189:5: note: 'std::swap'
189 | swap(_Tp& __a, _Tp& __b)
| ^~~~
/usr/include/c++/10/bits/move.h:189:5: note: 'std::swap'
In file included from /usr/include/c++/10/exception:147,
from /usr/include/c++/10/ios:39,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from dreaming.cpp:2:
/usr/include/c++/10/bits/exception_ptr.h:169:5: note: 'std::__exception_ptr::swap'
169 | swap(exception_ptr& __lhs, exception_ptr& __rhs)
| ^~~~
In file included from /usr/include/c++/10/filesystem:45,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129,
from dreaming.cpp:2:
/usr/include/c++/10/bits/fs_path.h:658:15: note: 'std::filesystem::__cxx11::swap'
658 | inline void swap(path& __lhs, path& __rhs) noexcept { __lhs.swap(__rhs); }
| ^~~~
dreaming.cpp:13:5: error: 'sz' was not declared in this scope
13 | sz[x]+=sz[y];
| ^~
dreaming.cpp:14:5: error: 'to' was not declared in this scope; did you mean 'tm'?
14 | to[y] = x;
| ^~
| tm
dreaming.cpp: In function 'int find(int)':
dreaming.cpp:18:8: error: 'link' was not declared in this scope
18 | if(x==link[x]) return x;
| ^~~~
dreaming.cpp:19:12: error: 'to' was not declared in this scope; did you mean 'tm'?
19 | return to[x] = find(to[x]);
| ^~
| tm
dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:33:2: error: 'vector' was not declared in this scope
33 | vector<pair<int, int>> node[N]; //node[a] = {b, w}
| ^~~~~~
dreaming.cpp:33:2: note: suggested alternatives:
In file included from /usr/include/c++/10/vector:67,
from /usr/include/c++/10/functional:62,
from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/10/algorithm:74,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from dreaming.cpp:2:
/usr/include/c++/10/bits/stl_vector.h:389:11: note: 'std::vector'
389 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
In file included from /usr/include/c++/10/functional:62,
from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/10/algorithm:74,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from dreaming.cpp:2:
/usr/include/c++/10/vector:86:13: note: 'std::pmr::vector'
86 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
| ^~~~~~
dreaming.cpp:33:9: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
33 | vector<pair<int, int>> node[N]; //node[a] = {b, w}
| ^~~~
| std::pair
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/bits/specfun.h:45,
from /usr/include/c++/10/cmath:1927,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
from dreaming.cpp:2:
/usr/include/c++/10/bits/stl_pair.h:211:12: note: 'std::pair' declared here
211 | struct pair
| ^~~~
dreaming.cpp:33:14: error: expected primary-expression before 'int'
33 | vector<pair<int, int>> node[N]; //node[a] = {b, w}
| ^~~
dreaming.cpp:34:14: error: expected primary-expression before 'int'
34 | vector<pair<int, int>> nodec[N]; //node[a] = {b, w}
| ^~~
dreaming.cpp:35:14: error: expected primary-expression before 'int'
35 | vector<pair<int, int>> noded[N]; //node[a] = {b, w}
| ^~~
dreaming.cpp:37:9: error: 'tuple' was not declared in this scope; did you mean 'std::tuple'?
37 | vector<tuple<int, int, int>> edges;
| ^~~~~
| std::tuple
In file included from /usr/include/c++/10/bits/move.h:57,
from /usr/include/c++/10/bits/stl_pair.h:59,
from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/bits/specfun.h:45,
from /usr/include/c++/10/cmath:1927,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
from dreaming.cpp:2:
/usr/include/c++/10/type_traits:2631:11: note: 'std::tuple' declared here
2631 | class tuple;
| ^~~~~
dreaming.cpp:37:15: error: expected primary-expression before 'int'
37 | vector<tuple<int, int, int>> edges;
| ^~~
dreaming.cpp:43:15: error: 'node' was not declared in this scope
43 | auto dfs = [&node, &comp, &dfs](int i, int n){
| ^~~~
dreaming.cpp:43:29: error: use of 'dfs' before deduction of 'auto'
43 | auto dfs = [&node, &comp, &dfs](int i, int n){
| ^~~
dreaming.cpp: In lambda function:
dreaming.cpp:44:6: error: 'visited' is not captured
44 | if(visited[i])return;
| ^~~~~~~
dreaming.cpp:43:32: note: the lambda has no capture-default
43 | auto dfs = [&node, &comp, &dfs](int i, int n){
| ^
dreaming.cpp:40:7: note: 'bool visited [N]' declared here
40 | bool visited[N];
| ^~~~~~~
dreaming.cpp:45:3: error: 'visited' is not captured
45 | visited[i] = true;
| ^~~~~~~
dreaming.cpp:43:32: note: the lambda has no capture-default
43 | auto dfs = [&node, &comp, &dfs](int i, int n){
| ^
dreaming.cpp:40:7: note: 'bool visited [N]' declared here
40 | bool visited[N];
| ^~~~~~~
dreaming.cpp:47:16: error: 'node' is not captured
47 | for(auto e : node[i])dfs(e.first, n);
| ^~~~
dreaming.cpp:43:32: note: the lambda has no capture-default
43 | auto dfs = [&node, &comp, &dfs](int i, int n){
| ^
dreaming.cpp:43:15: note: '<typeprefixerror>node' declared here
43 | auto dfs = [&node, &comp, &dfs](int i, int n){
| ^~~~
dreaming.cpp:47:24: error: use of 'dfs' before deduction of 'auto'
47 | for(auto e : node[i])dfs(e.first, n);
| ^~~
dreaming.cpp: In function 'int travelTime(int, int, int, int*, int*, int*)':
dreaming.cpp:50:2: error: expected ',' or ';' before 'for'
50 | for(int i = 0; i < M; i++){
| ^~~
dreaming.cpp:50:17: error: 'i' was not declared in this scope
50 | for(int i = 0; i < M; i++){
| ^
dreaming.cpp:81:9: error: expected primary-expression before 'int'
81 | vector<int> ord;
| ^~~
dreaming.cpp:85:7: error: 'nodec' was not declared in this scope
85 | if(nodec[i].size() == 1){
| ^~~~~
dreaming.cpp:89:8: error: 'ord' was not declared in this scope
89 | ord.push_back(i);
| ^~~
dreaming.cpp:97:9: error: expected primary-expression before 'int'
97 | vector<int> maxer(N), fin(N, -1);
| ^~~
dreaming.cpp:100:3: error: 't' was not declared in this scope
100 | t = ord[i];
| ^
dreaming.cpp:100:7: error: 'ord' was not declared in this scope
100 | t = ord[i];
| ^~~
dreaming.cpp:101:6: error: 'noded' was not declared in this scope
101 | if(noded[t].size() == 1){
| ^~~~~
dreaming.cpp:102:8: error: 'maxer' was not declared in this scope
102 | if((maxer[t] + noded[t][0].second) > maxer[noded[t][0].first]){
| ^~~~~
dreaming.cpp:104:5: error: 'fin' was not declared in this scope; did you mean 'find'?
104 | fin[comp[noded[t][0].first]] = noded[t][0].first;
| ^~~
| find
dreaming.cpp:123:7: error: 'fin' was not declared in this scope; did you mean 'finq'?
123 | if(fin[i]!=-1)finq = fin[i];
| ^~~
| finq
dreaming.cpp:126:4: error: 'edges' was not declared in this scope
126 | edges[i].push_back({L, i, finq});
| ^~~~~
dreaming.cpp:135:7: error: 'edges' was not declared in this scope
135 | sort(edges.rbegin(), edges.rend());
| ^~~~~
dreaming.cpp:135:2: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
135 | sort(edges.rbegin(), edges.rend());
| ^~~~
| std::sort
In file included from /usr/include/c++/10/algorithm:74,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from dreaming.cpp:2:
/usr/include/c++/10/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
dreaming.cpp:136:2: error: 'to' was not declared in this scope; did you mean 'tm'?
136 | to.resize(N);
| ^~
| tm
dreaming.cpp:137:2: error: 'sz' was not declared in this scope
137 | sz.resize(N, 0);
| ^~
dreaming.cpp:138:2: error: 'iota' was not declared in this scope; did you mean 'std::iota'?
138 | iota(to.begin(), to.end(), 0);
| ^~~~
| std::iota
In file included from /usr/include/c++/10/numeric:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:84,
from dreaming.cpp:2:
/usr/include/c++/10/bits/stl_numeric.h:88:5: note: 'std::iota' declared here
88 | iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value)
| ^~~~
dreaming.cpp:142:12: error: 'get' was not declared in this scope; did you mean 'std::get'?
142 | if(!same(get<1>(e), get<2>(e))){
| ^~~
| std::get
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:133,
from dreaming.cpp:2:
/usr/include/c++/10/variant:1099:27: note: 'std::get' declared here
1099 | constexpr const _Tp&& get(const variant<_Types...>&& __v)
| ^~~