nicegift.cpp: In function 'int main()':
nicegift.cpp:41:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (; cur.size() < k; ++it)
~~~~~~~~~~~^~~
nicegift.cpp:47:44: error: no match for 'operator-' (operand types are 'const long long int' and 'const std::pair<long long int, int>')
mn = min(mn, a.rbegin()->first - *it + 1);
~~~~~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0,
from /usr/include/c++/7/algorithm:61,
from nicegift.cpp:1:
/usr/include/c++/7/bits/stl_iterator.h:389: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>&)
operator-(const reverse_iterator<_IteratorL>& __x,
^~~~~~~~
/usr/include/c++/7/bits/stl_iterator.h:389:5: note: template argument deduction/substitution failed:
nicegift.cpp:47:47: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'const long long int'
mn = min(mn, a.rbegin()->first - *it + 1);
^~
In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0,
from /usr/include/c++/7/algorithm:61,
from nicegift.cpp:1:
/usr/include/c++/7/bits/stl_iterator.h:1191: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>&)
operator-(const move_iterator<_IteratorL>& __x,
^~~~~~~~
/usr/include/c++/7/bits/stl_iterator.h:1191:5: note: template argument deduction/substitution failed:
nicegift.cpp:47:47: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'const long long int'
mn = min(mn, a.rbegin()->first - *it + 1);
^~
In file included from /usr/include/c++/7/vector:65:0,
from nicegift.cpp:3:
/usr/include/c++/7/bits/stl_bvector.h:208:3: note: candidate: std::ptrdiff_t std::operator-(const std::_Bit_iterator_base&, const std::_Bit_iterator_base&)
operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y)
^~~~~~~~
/usr/include/c++/7/bits/stl_bvector.h:208:3: note: no known conversion for argument 1 from 'const long long int' to 'const std::_Bit_iterator_base&'
In file included from /usr/include/c++/7/deque:64:0,
from /usr/include/c++/7/queue:60,
from nicegift.cpp:4:
/usr/include/c++/7/bits/stl_deque.h:351:5: note: candidate: template<class _Tp, class _Ref, class _Ptr> typename std::_Deque_iterator<_Tp, _Ref, _Ptr>::difference_type std::operator-(const std::_Deque_iterator<_Tp, _Ref, _Ptr>&, const std::_Deque_iterator<_Tp, _Ref, _Ptr>&)
operator-(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
^~~~~~~~
/usr/include/c++/7/bits/stl_deque.h:351:5: note: template argument deduction/substitution failed:
nicegift.cpp:47:47: note: mismatched types 'const std::_Deque_iterator<_Tp, _Ref, _Ptr>' and 'const long long int'
mn = min(mn, a.rbegin()->first - *it + 1);
^~
In file included from /usr/include/c++/7/deque:64:0,
from /usr/include/c++/7/queue:60,
from nicegift.cpp:4:
/usr/include/c++/7/bits/stl_deque.h:363:5: note: candidate: template<class _Tp, class _RefL, class _PtrL, class _RefR, class _PtrR> typename std::_Deque_iterator<_Tp, _Ref, _Ptr>::difference_type std::operator-(const std::_Deque_iterator<_Tp, _Ref, _Ptr>&, const std::_Deque_iterator<_Tp, _RefR, _PtrR>&)
operator-(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
^~~~~~~~
/usr/include/c++/7/bits/stl_deque.h:363:5: note: template argument deduction/substitution failed:
nicegift.cpp:47:47: note: mismatched types 'const std::_Deque_iterator<_Tp, _Ref, _Ptr>' and 'const long long int'
mn = min(mn, a.rbegin()->first - *it + 1);
^~