race.cpp: In function 'void dfs(int, int, int)':
race.cpp:25:27: error: 'K' was not declared in this scope
25 | if(paths[pos][sum+K]) {
| ^
race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:36:14: error: no matching function for call to 'std::vector<std::vector<std::pair<int, int> > >::assign(int&, vi)'
36 | adjL.assign(N, vi());
| ~~~~~~~~~~~^~~~~~~~~
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 race.cpp:1:
/usr/include/c++/11/bits/stl_vector.h:768:9: note: candidate: 'template<class _InputIterator, class> void std::vector<_Tp, _Alloc>::assign(_InputIterator, _InputIterator) [with _InputIterator = _InputIterator; <template-parameter-2-2> = <template-parameter-1-2>; _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >]'
768 | assign(_InputIterator __first, _InputIterator __last)
| ^~~~~~
/usr/include/c++/11/bits/stl_vector.h:768:9: note: template argument deduction/substitution failed:
race.cpp:36:14: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'std::vector<int>')
36 | adjL.assign(N, vi());
| ~~~~~~~~~~~^~~~~~~~~
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 race.cpp:1:
/usr/include/c++/11/bits/stl_vector.h:749:7: note: candidate: 'void std::vector<_Tp, _Alloc>::assign(std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = std::vector<std::pair<int, int> >]'
749 | assign(size_type __n, const value_type& __val)
| ^~~~~~
/usr/include/c++/11/bits/stl_vector.h:749:47: note: no known conversion for argument 2 from 'vi' {aka 'std::vector<int>'} to 'const value_type&' {aka 'const std::vector<std::pair<int, int> >&'}
749 | assign(size_type __n, const value_type& __val)
| ~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/11/bits/stl_vector.h:794:7: note: candidate: 'void std::vector<_Tp, _Alloc>::assign(std::initializer_list<_Tp>) [with _Tp = std::vector<std::pair<int, int> >; _Alloc = std::allocator<std::vector<std::pair<int, int> > >]'
794 | assign(initializer_list<value_type> __l)
| ^~~~~~
/usr/include/c++/11/bits/stl_vector.h:794:7: note: candidate expects 1 argument, 2 provided
race.cpp:37:18: error: 'n' was not declared in this scope
37 | for(int i=0; i<n-1; ++i) {
| ^
race.cpp:41:6: error: too few arguments to function 'void dfs(int, int, int)'
41 | dfs(0,0);
| ~~~^~~~~
race.cpp:14:6: note: declared here
14 | void dfs(int pos, int prev, int sum) {
| ^~~