glo.cpp: In function 'int main()':
glo.cpp:43:23: error: no match for 'operator-' (operand types are 'int' and 'std::reverse_iterator<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >')
43 | int k = n - lower_bound(c.rbegin(), c.rend(), v[i]) + c.rbegin();
| ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| int std::reverse_iterator<__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/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from glo.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> 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:
glo.cpp:43:63: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
43 | int k = n - lower_bound(c.rbegin(), c.rend(), v[i]) + c.rbegin();
| ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from glo.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:1533:5: note: candidate: 'template<class _IteratorL, class _IteratorR> 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:
glo.cpp:43:63: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
43 | int k = n - lower_bound(c.rbegin(), c.rend(), v[i]) + c.rbegin();
| ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from glo.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:
glo.cpp:43:63: note: mismatched types 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>' and 'int'
43 | int k = n - lower_bound(c.rbegin(), c.rend(), v[i]) + c.rbegin();
| ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from glo.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:
glo.cpp:43:63: note: mismatched types 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' and 'int'
43 | int k = n - lower_bound(c.rbegin(), c.rend(), v[i]) + c.rbegin();
| ^
glo.cpp:50:23: error: no match for 'operator-' (operand types are 'int' and 'std::reverse_iterator<__gnu_cxx::__normal_iterator<int*, std::vector<int> > >')
50 | int k = n - lower_bound(c.rbegin(), c.rend(), v[i] + x) + c.rbegin();
| ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| int std::reverse_iterator<__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/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from glo.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> 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:
glo.cpp:50:67: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
50 | int k = n - lower_bound(c.rbegin(), c.rend(), v[i] + x) + c.rbegin();
| ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from glo.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:1533:5: note: candidate: 'template<class _IteratorL, class _IteratorR> 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:
glo.cpp:50:67: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
50 | int k = n - lower_bound(c.rbegin(), c.rend(), v[i] + x) + c.rbegin();
| ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from glo.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:
glo.cpp:50:67: note: mismatched types 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>' and 'int'
50 | int k = n - lower_bound(c.rbegin(), c.rend(), v[i] + x) + c.rbegin();
| ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/ios:40,
from /usr/include/c++/10/ostream:38,
from /usr/include/c++/10/iostream:39,
from glo.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:
glo.cpp:50:67: note: mismatched types 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' and 'int'
50 | int k = n - lower_bound(c.rbegin(), c.rend(), v[i] + x) + c.rbegin();
| ^