towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:12:19: error: 'getDistance' was not declared in this scope; did you mean 'hubDistance'?
12 | opt = max(opt, {getDistance(i, 0), i});
| ^~~~~~~~~~~
| hubDistance
towns.cpp:12:40: error: no matching function for call to 'max(std::array<int, 2>&, <brace-enclosed initializer list>)'
12 | opt = max(opt, {getDistance(i, 0), i});
| ^
In file included 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 towns.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'constexpr const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = std::array<int, 2>]'
254 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:36: note: no known conversion for argument 2 from '<brace-enclosed initializer list>' to 'const std::array<int, 2>&'
254 | max(const _Tp& __a, const _Tp& __b)
| ~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
300 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: template argument deduction/substitution failed:
towns.cpp:12:40: note: candidate expects 3 arguments, 2 provided
12 | opt = max(opt, {getDistance(i, 0), i});
| ^
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from towns.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
3480 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: template argument deduction/substitution failed:
towns.cpp:12:40: note: 'std::array<int, 2>' is not derived from 'std::initializer_list<_Tp>'
12 | opt = max(opt, {getDistance(i, 0), i});
| ^
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from towns.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
3486 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: template argument deduction/substitution failed:
towns.cpp:12:40: note: 'std::array<int, 2>' is not derived from 'std::initializer_list<_Tp>'
12 | opt = max(opt, {getDistance(i, 0), i});
| ^
towns.cpp:18:27: error: 'getDistance' was not declared in this scope; did you mean 'hubDistance'?
18 | opt = max(opt, {d1[i] = getDistance(i, a), i});
| ^~~~~~~~~~~
| hubDistance
towns.cpp:18:48: error: no matching function for call to 'max(std::array<int, 2>&, <brace-enclosed initializer list>)'
18 | opt = max(opt, {d1[i] = getDistance(i, a), i});
| ^
In file included 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 towns.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'constexpr const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = std::array<int, 2>]'
254 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:36: note: no known conversion for argument 2 from '<brace-enclosed initializer list>' to 'const std::array<int, 2>&'
254 | max(const _Tp& __a, const _Tp& __b)
| ~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
300 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: template argument deduction/substitution failed:
towns.cpp:18:48: note: candidate expects 3 arguments, 2 provided
18 | opt = max(opt, {d1[i] = getDistance(i, a), i});
| ^
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from towns.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
3480 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: template argument deduction/substitution failed:
towns.cpp:18:48: note: 'std::array<int, 2>' is not derived from 'std::initializer_list<_Tp>'
18 | opt = max(opt, {d1[i] = getDistance(i, a), i});
| ^
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from towns.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
3486 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: template argument deduction/substitution failed:
towns.cpp:18:48: note: 'std::array<int, 2>' is not derived from 'std::initializer_list<_Tp>'
18 | opt = max(opt, {d1[i] = getDistance(i, a), i});
| ^
towns.cpp:26:11: error: 'getDistance' was not declared in this scope; did you mean 'hubDistance'?
26 | d2[i] = getDistance(i, b);
| ^~~~~~~~~~~
| hubDistance
towns.cpp:29:10: error: 'INF' was not declared in this scope
29 | int R = INF;
| ^~~
towns.cpp:8:28: warning: unused parameter 'sub' [-Wunused-parameter]
8 | int hubDistance(int n, int sub)
| ~~~~^~~