walk.cpp: In function 'll dijkstra(int, int, int)':
walk.cpp:25:39: error: no matching function for call to 'begin(std::pair<int, int>&)'
25 | for (auto p : adjlist[f.second]){
| ^
In file included from /usr/include/c++/9/bits/stl_vector.h:63,
from /usr/include/c++/9/vector:67,
from walk.h:4,
from walk.cpp:1:
/usr/include/c++/9/initializer_list:89:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)'
89 | begin(initializer_list<_Tp> __ils) noexcept
| ^~~~~
/usr/include/c++/9/initializer_list:89:5: note: template argument deduction/substitution failed:
walk.cpp:25:39: note: 'std::pair<int, int>' is not derived from 'std::initializer_list<_Tp>'
25 | for (auto p : adjlist[f.second]){
| ^
In file included from /usr/include/c++/9/vector:69,
from walk.h:4,
from walk.cpp:1:
/usr/include/c++/9/bits/range_access.h:48:5: note: candidate: 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&)'
48 | begin(_Container& __cont) -> decltype(__cont.begin())
| ^~~~~
/usr/include/c++/9/bits/range_access.h:48:5: note: template argument deduction/substitution failed:
/usr/include/c++/9/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.begin()) std::begin(_Container&) [with _Container = std::pair<int, int>]':
walk.cpp:25:39: required from here
/usr/include/c++/9/bits/range_access.h:48:50: error: 'struct std::pair<int, int>' has no member named 'begin'
48 | begin(_Container& __cont) -> decltype(__cont.begin())
| ~~~~~~~^~~~~
/usr/include/c++/9/bits/range_access.h:58:5: note: candidate: 'template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)'
58 | begin(const _Container& __cont) -> decltype(__cont.begin())
| ^~~~~
/usr/include/c++/9/bits/range_access.h:58:5: note: template argument deduction/substitution failed:
/usr/include/c++/9/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.begin()) std::begin(const _Container&) [with _Container = std::pair<int, int>]':
walk.cpp:25:39: required from here
/usr/include/c++/9/bits/range_access.h:58:56: error: 'const struct std::pair<int, int>' has no member named 'begin'
58 | begin(const _Container& __cont) -> decltype(__cont.begin())
| ~~~~~~~^~~~~
/usr/include/c++/9/bits/range_access.h:87:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])'
87 | begin(_Tp (&__arr)[_Nm])
| ^~~~~
/usr/include/c++/9/bits/range_access.h:87:5: note: template argument deduction/substitution failed:
walk.cpp:25:39: note: mismatched types '_Tp [_Nm]' and 'std::pair<int, int>'
25 | for (auto p : adjlist[f.second]){
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from walk.cpp:2:
/usr/include/c++/9/valarray:1214:5: note: candidate: 'template<class _Tp> _Tp* std::begin(std::valarray<_Tp>&)'
1214 | begin(valarray<_Tp>& __va)
| ^~~~~
/usr/include/c++/9/valarray:1214:5: note: template argument deduction/substitution failed:
walk.cpp:25:39: note: 'std::pair<int, int>' is not derived from 'std::valarray<_Tp>'
25 | for (auto p : adjlist[f.second]){
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from walk.cpp:2:
/usr/include/c++/9/valarray:1224:5: note: candidate: 'template<class _Tp> const _Tp* std::begin(const std::valarray<_Tp>&)'
1224 | begin(const valarray<_Tp>& __va)
| ^~~~~
/usr/include/c++/9/valarray:1224:5: note: template argument deduction/substitution failed:
walk.cpp:25:39: note: 'std::pair<int, int>' is not derived from 'const std::valarray<_Tp>'
25 | for (auto p : adjlist[f.second]){
| ^
walk.cpp:25:39: error: no matching function for call to 'end(std::pair<int, int>&)'
In file included from /usr/include/c++/9/bits/stl_vector.h:63,
from /usr/include/c++/9/vector:67,
from walk.h:4,
from walk.cpp:1:
/usr/include/c++/9/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)'
99 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
/usr/include/c++/9/initializer_list:99:5: note: template argument deduction/substitution failed:
walk.cpp:25:39: note: 'std::pair<int, int>' is not derived from 'std::initializer_list<_Tp>'
25 | for (auto p : adjlist[f.second]){
| ^
In file included from /usr/include/c++/9/vector:69,
from walk.h:4,
from walk.cpp:1:
/usr/include/c++/9/bits/range_access.h:68:5: note: candidate: 'template<class _Container> decltype (__cont.end()) std::end(_Container&)'
68 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/9/bits/range_access.h:68:5: note: template argument deduction/substitution failed:
/usr/include/c++/9/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.end()) std::end(_Container&) [with _Container = std::pair<int, int>]':
walk.cpp:25:39: required from here
/usr/include/c++/9/bits/range_access.h:68:48: error: 'struct std::pair<int, int>' has no member named 'end'
68 | end(_Container& __cont) -> decltype(__cont.end())
| ~~~~~~~^~~
/usr/include/c++/9/bits/range_access.h:78:5: note: candidate: 'template<class _Container> decltype (__cont.end()) std::end(const _Container&)'
78 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/9/bits/range_access.h:78:5: note: template argument deduction/substitution failed:
/usr/include/c++/9/bits/range_access.h: In substitution of 'template<class _Container> decltype (__cont.end()) std::end(const _Container&) [with _Container = std::pair<int, int>]':
walk.cpp:25:39: required from here
/usr/include/c++/9/bits/range_access.h:78:54: error: 'const struct std::pair<int, int>' has no member named 'end'
78 | end(const _Container& __cont) -> decltype(__cont.end())
| ~~~~~~~^~~
/usr/include/c++/9/bits/range_access.h:97:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
97 | end(_Tp (&__arr)[_Nm])
| ^~~
/usr/include/c++/9/bits/range_access.h:97:5: note: template argument deduction/substitution failed:
walk.cpp:25:39: note: mismatched types '_Tp [_Nm]' and 'std::pair<int, int>'
25 | for (auto p : adjlist[f.second]){
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from walk.cpp:2:
/usr/include/c++/9/valarray:1234:5: note: candidate: 'template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)'
1234 | end(valarray<_Tp>& __va)
| ^~~
/usr/include/c++/9/valarray:1234:5: note: template argument deduction/substitution failed:
walk.cpp:25:39: note: 'std::pair<int, int>' is not derived from 'std::valarray<_Tp>'
25 | for (auto p : adjlist[f.second]){
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from walk.cpp:2:
/usr/include/c++/9/valarray:1244:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)'
1244 | end(const valarray<_Tp>& __va)
| ^~~
/usr/include/c++/9/valarray:1244:5: note: template argument deduction/substitution failed:
walk.cpp:25:39: note: 'std::pair<int, int>' is not derived from 'const std::valarray<_Tp>'
25 | for (auto p : adjlist[f.second]){
| ^
walk.cpp:28:56: error: no matching function for call to 'std::set<std::pair<long long int, int> >::insert(<brace-enclosed initializer list>)'
28 | pq.insert({distance[p.second],p.second});
| ^
In file included from /usr/include/c++/9/set:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:87,
from walk.cpp:2:
/usr/include/c++/9/bits/stl_set.h:509:7: note: candidate: 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const value_type&) [with _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator = std::_Rb_tree_const_iterator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::value_type = std::pair<long long int, int>]'
509 | insert(const value_type& __x)
| ^~~~~~
/usr/include/c++/9/bits/stl_set.h:509:32: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::pair<long long int, int>&'}
509 | insert(const value_type& __x)
| ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_set.h:518:7: note: candidate: 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::value_type&&) [with _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator = std::_Rb_tree_const_iterator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::value_type = std::pair<long long int, int>]'
518 | insert(value_type&& __x)
| ^~~~~~
/usr/include/c++/9/bits/stl_set.h:518:27: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::set<std::pair<long long int, int> >::value_type&&' {aka 'std::pair<long long int, int>&&'}
518 | insert(value_type&& __x)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_set.h:546:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::const_iterator, const value_type&) [with _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree_const_iterator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree_const_iterator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::value_type = std::pair<long long int, int>]'
546 | insert(const_iterator __position, const value_type& __x)
| ^~~~~~
/usr/include/c++/9/bits/stl_set.h:546:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/9/bits/stl_set.h:551:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::const_iterator, std::set<_Key, _Compare, _Alloc>::value_type&&) [with _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree_const_iterator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree_const_iterator<std::pair<long long int, int> >; std::set<_Key, _Compare, _Alloc>::value_type = std::pair<long long int, int>]'
551 | insert(const_iterator __position, value_type&& __x)
| ^~~~~~
/usr/include/c++/9/bits/stl_set.h:551:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/9/bits/stl_set.h:566:2: note: candidate: 'template<class _InputIterator> void std::set<_Key, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _InputIterator = _InputIterator; _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >]'
566 | insert(_InputIterator __first, _InputIterator __last)
| ^~~~~~
/usr/include/c++/9/bits/stl_set.h:566:2: note: template argument deduction/substitution failed:
walk.cpp:28:56: note: candidate expects 2 arguments, 1 provided
28 | pq.insert({distance[p.second],p.second});
| ^
In file included from /usr/include/c++/9/set:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:87,
from walk.cpp:2:
/usr/include/c++/9/bits/stl_set.h:578:7: note: candidate: 'void std::set<_Key, _Compare, _Alloc>::insert(std::initializer_list<_Tp>) [with _Key = std::pair<long long int, int>; _Compare = std::less<std::pair<long long int, int> >; _Alloc = std::allocator<std::pair<long long int, int> >]'
578 | insert(initializer_list<value_type> __l)
| ^~~~~~
/usr/include/c++/9/bits/stl_set.h:578:43: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::initializer_list<std::pair<long long int, int> >'
578 | insert(initializer_list<value_type> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
walk.cpp: In function 'long long int min_distance(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, int, int)':
walk.cpp:89:57: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(std::vector<std::pair<long long int, int> >)'
89 | adjlist.push_back(vector<pair<ll,int>>());
| ^
In file included from /usr/include/c++/9/vector:67,
from walk.h:4,
from walk.cpp:1:
/usr/include/c++/9/bits/stl_vector.h:1184: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>]'
1184 | push_back(const value_type& __x)
| ^~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:1184:35: note: no known conversion for argument 1 from 'std::vector<std::pair<long long int, int> >' to 'const value_type&' {aka 'const std::pair<int, int>&'}
1184 | push_back(const value_type& __x)
| ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/9/bits/stl_vector.h:1200: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>]'
1200 | push_back(value_type&& __x)
| ^~~~~~~~~
/usr/include/c++/9/bits/stl_vector.h:1200:30: note: no known conversion for argument 1 from 'std::vector<std::pair<long long int, int> >' to 'std::vector<std::pair<int, int> >::value_type&&' {aka 'std::pair<int, int>&&'}
1200 | push_back(value_type&& __x)
| ~~~~~~~~~~~~~^~~
walk.cpp:90:34: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'push_back'
90 | adjlist[curnode].push_back({y[inds[i]]-lastheight[j],lastnode[j]});
| ^~~~~~~~~
walk.cpp:91:38: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'push_back'
91 | adjlist[lastnode[j]].push_back({y[inds[i]]-lastheight[j],curnode});
| ^~~~~~~~~
walk.cpp:99:38: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'push_back'
99 | adjlist[lastnode[j]].push_back({x[j]-x[prev],lastnode[prev]});
| ^~~~~~~~~
walk.cpp:100:41: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'push_back'
100 | adjlist[lastnode[prev]].push_back({x[j]-x[prev],lastnode[j]});
| ^~~~~~~~~
walk.cpp:51:9: warning: unused variable 'numnodes' [-Wunused-variable]
51 | int numnodes = 0;
| ^~~~~~~~