Main.cpp:8:7: error: conflicting declaration 'int v'
8 | int u,v,w;
| ^
Main.cpp:6:13: note: previous declaration as 'std::vector<int> v [100100]'
6 | vector<int> v[100100];
| ^
Main.cpp: In function 'void digfs(int, int, int, int, int)':
Main.cpp:29:14: error: too few arguments to function 'void digfs(int, int, int, int, int)'
29 | digfs(ii.first,i,vi,de+1);
| ~~~~~^~~~~~~~~~~~~~~~~~~~
Main.cpp:23:6: note: declared here
23 | void digfs(int i, int p, int vi, int de, int bog){
| ^~~~~
Main.cpp: In function 'long long int decomp(int)':
Main.cpp:35:8: error: too few arguments to function 'void dfs(int, int, int)'
35 | dfs(i,-1);
| ~~~^~~~~~
Main.cpp:12:6: note: declared here
12 | void dfs(int i, int p, int de){
| ^~~
Main.cpp:43:49: error: 'p' was not declared in this scope
43 | if(visited[ii.first] || ii.first == p) continue;
| ^
Main.cpp:58:14: error: too few arguments to function 'void digfs(int, int, int, int, int)'
58 | digfs(ii.first,c,1,cont);
| ~~~~~^~~~~~~~~~~~~~~~~~~
Main.cpp:23:6: note: declared here
23 | void digfs(int i, int p, int vi, int de, int bog){
| ^~~~~
Main.cpp:63:1: warning: no return statement in function returning non-void [-Wreturn-type]
63 | }
| ^
Main.cpp: In function 'int main()':
Main.cpp:68:18: error: 'K' was not declared in this scope
68 | scanf(" %d",&K);
| ^
Main.cpp:72:18: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'std::vector<int> (*)[100100]' [-Wformat=]
72 | scanf(" %d",&v);
| ~^ ~~
| | |
| | std::vector<int> (*)[100100]
| int*
Main.cpp:74:14: error: 'k' was not declared in this scope
74 | w -= k;
| ^
Main.cpp:75:28: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(<brace-enclosed initializer list>)'
75 | adjlst[u].push_back({v,w});
| ~~~~~~~~~~~~~~~~~~~^~~~~~~
In file included from /usr/include/c++/11/vector:67,
from /usr/include/c++/11/functional:62,
from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/11/algorithm:74,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
from Main.cpp:1:
/usr/include/c++/11/bits/stl_vector.h:1187:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<int, int>]'
1187 | push_back(const value_type& __x)
| ^~~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:1187:35: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::pair<int, int>&'}
1187 | push_back(const value_type& __x)
| ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/11/bits/stl_vector.h:1203:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; std::vector<_Tp, _Alloc>::value_type = std::pair<int, int>]'
1203 | push_back(value_type&& __x)
| ^~~~~~~~~
/usr/include/c++/11/bits/stl_vector.h:1203:30: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::pair<int, int> >::value_type&&' {aka 'std::pair<int, int>&&'}
1203 | push_back(value_type&& __x)
| ~~~~~~~~~~~~~^~~
Main.cpp:76:15: error: invalid types 'std::vector<std::pair<int, int> > [100100][std::vector<int> [100100]]' for array subscript
76 | adjlst[v].push_back({u,w});
| ^
Main.cpp:67:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
67 | scanf(" %d",&N);
| ~~~~~^~~~~~~~~~
Main.cpp:71:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
71 | scanf(" %d",&u);
| ~~~~~^~~~~~~~~~
Main.cpp:72:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
72 | scanf(" %d",&v);
| ~~~~~^~~~~~~~~~
Main.cpp:73:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
73 | scanf(" %d",&w);
| ~~~~~^~~~~~~~~~