wiring.cpp: In function 'll min_total_lenght(std::vector<int>, std::vector<int>)':
wiring.cpp:75:51: error: no match for 'operator-' (operand types are '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' and 'std::vector<int>')
75 | int ind = lower_bound(all(pos[op]), v[i].first) - pos[op];
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~
| | |
| | std::vector<int>
| __gnu_cxx::__normal_iterator<int*, std::vector<int> >
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
from /usr/include/c++/10/vector:60,
from wiring.h:1,
from wiring.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:1026:7: note: candidate: '__gnu_cxx::__normal_iterator<_Iterator, _Container> __gnu_cxx::__normal_iterator<_Iterator, _Container>::operator-(__gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type) const [with _Iterator = int*; _Container = std::vector<int>; __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type = long int]'
1026 | operator-(difference_type __n) const _GLIBCXX_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:1026:33: note: no known conversion for argument 1 from 'std::vector<int>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type' {aka 'long int'}
1026 | operator-(difference_type __n) const _GLIBCXX_NOEXCEPT
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)'
500 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed:
wiring.cpp:75:59: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'const std::reverse_iterator<_Iterator>'
75 | int ind = lower_bound(all(pos[op]), v[i].first) - pos[op];
| ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
from /usr/include/c++/10/vector:60,
from wiring.h:1,
from wiring.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:1533:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)'
1533 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:1533:5: note: template argument deduction/substitution failed:
wiring.cpp:75:59: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'const std::move_iterator<_IteratorL>'
75 | int ind = lower_bound(all(pos[op]), v[i].first) - pos[op];
| ^
In file included from wiring.cpp:3:
/usr/include/c++/10/complex:361:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const std::complex<_Tp>&, const std::complex<_Tp>&)'
361 | operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/10/complex:361:5: note: template argument deduction/substitution failed:
wiring.cpp:75:59: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'const std::complex<_Tp>'
75 | int ind = lower_bound(all(pos[op]), v[i].first) - pos[op];
| ^
In file included from wiring.cpp:3:
/usr/include/c++/10/complex:370:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const std::complex<_Tp>&, const _Tp&)'
370 | operator-(const complex<_Tp>& __x, const _Tp& __y)
| ^~~~~~~~
/usr/include/c++/10/complex:370:5: note: template argument deduction/substitution failed:
wiring.cpp:75:59: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'const std::complex<_Tp>'
75 | int ind = lower_bound(all(pos[op]), v[i].first) - pos[op];
| ^
In file included from wiring.cpp:3:
/usr/include/c++/10/complex:379:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const _Tp&, const std::complex<_Tp>&)'
379 | operator-(const _Tp& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/10/complex:379:5: note: template argument deduction/substitution failed:
wiring.cpp:75:59: note: 'std::vector<int>' is not derived from 'const std::complex<_Tp>'
75 | int ind = lower_bound(all(pos[op]), v[i].first) - pos[op];
| ^
In file included from wiring.cpp:3:
/usr/include/c++/10/complex:456:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const std::complex<_Tp>&)'
456 | operator-(const complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/10/complex:456:5: note: template argument deduction/substitution failed:
wiring.cpp:75:59: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'const std::complex<_Tp>'
75 | int ind = lower_bound(all(pos[op]), v[i].first) - pos[op];
| ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
from /usr/include/c++/10/vector:60,
from wiring.h:1,
from wiring.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:1164:5: note: candidate: 'template<class _IteratorL, class _IteratorR, class _Container> decltype ((__lhs.base() - __rhs.base())) __gnu_cxx::operator-(const __gnu_cxx::__normal_iterator<_IteratorL, _Container>&, const __gnu_cxx::__normal_iterator<_IteratorR, _Container>&)'
1164 | operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
| ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:1164:5: note: template argument deduction/substitution failed:
wiring.cpp:75:59: note: 'std::vector<int>' is not derived from 'const __gnu_cxx::__normal_iterator<_IteratorR, _Container>'
75 | int ind = lower_bound(all(pos[op]), v[i].first) - pos[op];
| ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
from /usr/include/c++/10/vector:60,
from wiring.h:1,
from wiring.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:1177:5: note: candidate: 'template<class _Iterator, class _Container> typename __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type __gnu_cxx::operator-(const __gnu_cxx::__normal_iterator<_Iterator, _Container>&, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)'
1177 | operator-(const __normal_iterator<_Iterator, _Container>& __lhs,
| ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:1177:5: note: template argument deduction/substitution failed:
wiring.cpp:75:59: note: 'std::vector<int>' is not derived from 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>'
75 | int ind = lower_bound(all(pos[op]), v[i].first) - pos[op];
| ^
wiring.cpp:79:45: 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 'x'
79 | chkmin(close, (ll)abs(pos[op][d] - v[i].x));
| ^