In file included from /usr/include/c++/10/map:60,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
from knapsack.cpp:7:
/usr/include/c++/10/bits/stl_tree.h: In instantiation of 'struct std::_Rb_tree_key_compare<std::greater<int>()>':
/usr/include/c++/10/bits/stl_tree.h:677:9: required from 'struct std::_Rb_tree<int, std::pair<const int, std::vector<std::pair<int, int> > >, std::_Select1st<std::pair<const int, std::vector<std::pair<int, int> > > >, std::greater<int>(), std::allocator<std::pair<const int, std::vector<std::pair<int, int> > > > >::_Rb_tree_impl<std::greater<int>(), false>'
/usr/include/c++/10/bits/stl_tree.h:720:31: required from 'class std::_Rb_tree<int, std::pair<const int, std::vector<std::pair<int, int> > >, std::_Select1st<std::pair<const int, std::vector<std::pair<int, int> > > >, std::greater<int>(), std::allocator<std::pair<const int, std::vector<std::pair<int, int> > > > >'
/usr/include/c++/10/bits/stl_map.h:153:17: required from 'class std::map<int, std::vector<std::pair<int, int> >, std::greater<int>()>'
knapsack.cpp:64:54: required from here
/usr/include/c++/10/bits/stl_tree.h:144:21: error: data member 'std::_Rb_tree_key_compare<std::greater<int>()>::_M_key_compare' invalidly declared function type
144 | _Key_compare _M_key_compare;
| ^~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h: In instantiation of 'class std::_Rb_tree<int, std::pair<const int, std::vector<std::pair<int, int> > >, std::_Select1st<std::pair<const int, std::vector<std::pair<int, int> > > >, std::greater<int>(), std::allocator<std::pair<const int, std::vector<std::pair<int, int> > > > >':
/usr/include/c++/10/bits/stl_map.h:153:17: required from 'class std::map<int, std::vector<std::pair<int, int> >, std::greater<int>()>'
knapsack.cpp:64:54: required from here
/usr/include/c++/10/bits/stl_tree.h:998:7: error: function returning a function
998 | key_comp() const
| ^~~~~~~~
In file included from /usr/include/c++/10/map:61,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
from knapsack.cpp:7:
/usr/include/c++/10/bits/stl_map.h: In instantiation of 'class std::map<int, std::vector<std::pair<int, int> >, std::greater<int>()>':
knapsack.cpp:64:54: required from here
/usr/include/c++/10/bits/stl_map.h:1142:7: error: function returning a function
1142 | key_comp() const
| ^~~~~~~~
knapsack.cpp: In function 'int main()':
knapsack.cpp:98:34: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
98 | if (dp[i].wI < j->s.size() - 1) {
In file included from /usr/include/c++/10/map:60,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
from knapsack.cpp:7:
/usr/include/c++/10/bits/stl_tree.h: In instantiation of 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::find(const _Key&) [with _Key = int; _Val = std::pair<const int, std::vector<std::pair<int, int> > >; _KeyOfValue = std::_Select1st<std::pair<const int, std::vector<std::pair<int, int> > > >; _Compare = std::greater<int>(); _Alloc = std::allocator<std::pair<const int, std::vector<std::pair<int, int> > > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator = std::_Rb_tree<int, std::pair<const int, std::vector<std::pair<int, int> > >, std::_Select1st<std::pair<const int, std::vector<std::pair<int, int> > > >, std::greater<int>(), std::allocator<std::pair<const int, std::vector<std::pair<int, int> > > > >::iterator]':
/usr/include/c++/10/bits/stl_map.h:1170:25: required from 'std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::find(const key_type&) [with _Key = int; _Tp = std::vector<std::pair<int, int> >; _Compare = std::greater<int>(); _Alloc = std::allocator<std::pair<const int, std::vector<std::pair<int, int> > > >; std::map<_Key, _Tp, _Compare, _Alloc>::iterator = std::_Rb_tree<int, std::pair<const int, std::vector<std::pair<int, int> > >, std::_Select1st<std::pair<const int, std::vector<std::pair<int, int> > > >, std::greater<int>(), std::allocator<std::pair<const int, std::vector<std::pair<int, int> > > > >::iterator; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = int]'
knapsack.cpp:85:46: required from here
/usr/include/c++/10/bits/stl_tree.h:2555:33: error: too many arguments to function
2555 | || _M_impl._M_key_compare(__k,
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~
2556 | _S_key(__j._M_node))) ? end() : __j;
| ~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:2555:8: error: no match for 'operator||' (operand types are 'bool' and 'std::greater<int>')
2554 | return (__j == end()
| ~~~~~~~~~~~~~
2555 | || _M_impl._M_key_compare(__k,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2556 | _S_key(__j._M_node))) ? end() : __j;
| ~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:2555:8: note: candidate: 'operator||(bool, bool)' (built-in)
/usr/include/c++/10/bits/stl_tree.h:2555:8: note: no known conversion for argument 2 from 'std::greater<int>' to 'bool'
In file included from /usr/include/c++/10/valarray:603,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95,
from knapsack.cpp:7:
/usr/include/c++/10/bits/valarray_after.h:416:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__logical_or, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__logical_or, typename _Dom1::value_type>::result_type> std::operator||(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&)'
416 | _DEFINE_EXPR_BINARY_OPERATOR(||, __logical_or)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/valarray_after.h:416:5: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/10/map:60,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
from knapsack.cpp:7:
/usr/include/c++/10/bits/stl_tree.h:2555:8: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool'
2554 | return (__j == end()
| ~~~~~~~~~~~~~
2555 | || _M_impl._M_key_compare(__k,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2556 | _S_key(__j._M_node))) ? end() : __j;
| ~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/10/valarray:603,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95,
from knapsack.cpp:7:
/usr/include/c++/10/bits/valarray_after.h:416:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_or, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_or, typename _Dom1::value_type>::result_type> std::operator||(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
416 | _DEFINE_EXPR_BINARY_OPERATOR(||, __logical_or)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/valarray_after.h:416:5: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/10/map:60,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
from knapsack.cpp:7:
/usr/include/c++/10/bits/stl_tree.h:2555:8: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool'
2554 | return (__j == end()
| ~~~~~~~~~~~~~
2555 | || _M_impl._M_key_compare(__k,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2556 | _S_key(__j._M_node))) ? end() : __j;
| ~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/10/valarray:603,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95,
from knapsack.cpp:7:
/usr/include/c++/10/bits/valarray_after.h:416:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_or, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_or, typename _Dom1::value_type>::result_type> std::operator||(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)'
416 | _DEFINE_EXPR_BINARY_OPERATOR(||, __logical_or)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/valarray_after.h:416:5: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/10/map:60,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
from knapsack.cpp:7:
/usr/include/c++/10/bits/stl_tree.h:2555:8: note: 'std::greater<int>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
2554 | return (__j == end()
| ~~~~~~~~~~~~~
2555 | || _M_impl._M_key_compare(__k,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2556 | _S_key(__j._M_node))) ? end() : __j;
| ~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/10/valarray:603,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95,
from knapsack.cpp:7:
/usr/include/c++/10/bits/valarray_after.h:416:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_or, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__logical_or, typename _Dom1::value_type>::result_type> std::operator||(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _Dom::value_type>&)'
416 | _DEFINE_EXPR_BINARY_OPERATOR(||, __logical_or)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/valarray_after.h:416:5: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/10/map:60,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
from knapsack.cpp:7:
/usr/include/c++/10/bits/stl_tree.h:2555:8: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'bool'
2554 | return (__j == end()
| ~~~~~~~~~~~~~
2555 | || _M_impl._M_key_compare(__k,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2556 | _S_key(__j._M_node))) ? end() : __j;
| ~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/10/valarray:603,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95,
from knapsack.cpp:7:
/usr/include/c++/10/bits/valarray_after.h:416:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__logical_or, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__logical_or, typename _Dom1::value_type>::result_type> std::operator||(const std::valarray<typename _Dom::value_type>&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)'
416 | _DEFINE_EXPR_BINARY_OPERATOR(||, __logical_or)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/valarray_after.h:416:5: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/10/map:60,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
from knapsack.cpp:7:
/usr/include/c++/10/bits/stl_tree.h:2555:8: note: 'std::greater<int>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
2554 | return (__j == end()
| ~~~~~~~~~~~~~
2555 | || _M_impl._M_key_compare(__k,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2556 | _S_key(__j._M_node))) ? end() : __j;
| ~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95,
from knapsack.cpp:7:
/usr/include/c++/10/valarray:1196:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__logical_or, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__logical_or, _Tp>::result_type> std::operator||(const std::valarray<_Tp>&, const std::valarray<_Tp>&)'
1196 | _DEFINE_BINARY_OPERATOR(||, __logical_or)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/valarray:1196:1: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/10/map:60,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
from knapsack.cpp:7:
/usr/include/c++/10/bits/stl_tree.h:2555:8: note: mismatched types 'const std::valarray<_Tp>' and 'bool'
2554 | return (__j == end()
| ~~~~~~~~~~~~~
2555 | || _M_impl._M_key_compare(__k,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2556 | _S_key(__j._M_node))) ? end() : __j;
| ~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95,
from knapsack.cpp:7:
/usr/include/c++/10/valarray:1196:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__logical_or, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__logical_or, _Tp>::result_type> std::operator||(const std::valarray<_Tp>&, const typename std::valarray<_Tp>::value_type&)'
1196 | _DEFINE_BINARY_OPERATOR(||, __logical_or)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/valarray:1196:1: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/10/map:60,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
from knapsack.cpp:7:
/usr/include/c++/10/bits/stl_tree.h:2555:8: note: mismatched types 'const std::valarray<_Tp>' and 'bool'
2554 | return (__j == end()
| ~~~~~~~~~~~~~
2555 | || _M_impl._M_key_compare(__k,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2556 | _S_key(__j._M_node))) ? end() : __j;
| ~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95,
from knapsack.cpp:7:
/usr/include/c++/10/valarray:1196:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__logical_or, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__logical_or, _Tp>::result_type> std::operator||(const typename std::valarray<_Tp>::value_type&, const std::valarray<_Tp>&)'
1196 | _DEFINE_BINARY_OPERATOR(||, __logical_or)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/valarray:1196:1: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/10/map:60,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:81,
from knapsack.cpp:7:
/usr/include/c++/10/bits/stl_tree.h:2555:8: note: 'std::greater<int>' is not derived from 'const std::valarray<_Tp>'
2554 | return (__j == end()
| ~~~~~~~~~~~~~
2555 | || _M_impl._M_key_compare(__k,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2556 | _S_key(__j._M_node))) ? end() : __j;
| ~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h: In instantiation of 'std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_hint_unique_pos(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator, const key_type&) [with _Key = int; _Val = std::pair<const int, std::vector<std::pair<int, int> > >; _KeyOfValue = std::_Select1st<std::pair<const int, std::vector<std::pair<int, int> > > >; _Compare = std::greater<int>(); _Alloc = std::allocator<std::pair<const int, std::vector<std::pair<int, int> > > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator = std::_Rb_tree<int, std::pair<const int, std::vector<std::pair<int, int> > >, std::_Select1st<std::pair<const int, std::vector<std::pair<int, int> > > >, std::greater<int>(), std::allocator<std::pair<const int, std::vector<std::pair<int, int> > > > >::const_iterator; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::key_type = int]':
/usr/include/c++/10/bits/stl_tree.h:2465:19: required from 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_emplace_hint_unique(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator, _Args&& ...) [with _Args = {const std::piecewise_construct_t&, std::tuple<const int&>, std::tuple<>}; _Key = int; _Val = std::pair<const int, std::vector<std::pair<int, int> > >; _KeyOfValue = std::_Select1st<std::pair<const int, std::vector<std::pair<int, int> > > >; _Compare = std::greater<int>(); _Alloc = std::allocator<std::pair<const int, std::vector<std::pair<int, int> > > >; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator = std::_Rb_tree<int, std::pair<const int, std::vector<std::pair<int, int> > >, std::_Select1st<std::pair<const int, std::vector<std::pair<int, int> > > >, std::greater<int>(), std::allocator<std::pair<const int, std::vector<std::pair<int, int> > > > >::iterator; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator = std::_Rb_tree<int, std::pair<const int, std::vector<std::pair<int, int> > >, std::_Select1st<std::pair<const int, std::vector<std::pair<int, int> > > >, std::greater<int>(), std::allocator<std::pair<const int, std::vector<std::pair<int, int> > > > >::const_iterator]'
/usr/include/c++/10/bits/stl_map.h:501:37: required from 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = int; _Tp = std::vector<std::pair<int, int> >; _Compare = std::greater<int>(); _Alloc = std::allocator<std::pair<const int, std::vector<std::pair<int, int> > > >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = std::vector<std::pair<int, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = int]'
knapsack.cpp:68:25: required from here
/usr/include/c++/10/bits/stl_tree.h:2204:33: error: too many arguments to function
2204 | && _M_impl._M_key_compare(_S_key(_M_rightmost()), __k))
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:2204:8: error: no match for 'operator&&' (operand types are 'bool' and 'std::greater<int>')
2203 | if (size() > 0
| ~~~~~~~~~~
2204 | && _M_impl._M_key_compare(_S_key(_M_rightmost()), __k))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_tree.h:2204:8: note: candidate: 'operator&&(bool, bool)' (built-in)
/usr/include/c++/10/bits/stl_tree.h:2204:8: note: no known conversion for argument 2 from 'std::greater<int>' to 'bool'
In file included from /usr/include/c++/10/valarray:603,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95,
from knapsack.cpp:7:
/usr/include/c++/10/bits/valarray_after.h:415:5: note: