Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:16:6: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
    if(dp[j]>=a[i].second)
      ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:71:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = std::pair<int, int>*; _Iterator2 = std::pair<int, int>*; _Compare = std::greater<int>]':
/usr/include/c++/6/bits/stl_algo.h:1844:14:   required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = std::pair<int, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<std::greater<int> >]'
/usr/include/c++/6/bits/stl_algo.h:1882:25:   required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = std::pair<int, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<std::greater<int> >]'
/usr/include/c++/6/bits/stl_algo.h:1968:31:   required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = std::pair<int, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<std::greater<int> >]'
/usr/include/c++/6/bits/stl_algo.h:4739:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = std::pair<int, int>*; _Compare = std::greater<int>]'
/in/foo.cc:10:31:   required from here
/usr/include/c++/6/bits/predefined_ops.h:125:18: error: no match for call to '(std::greater<int>) (std::pair<int, int>&, std::pair<int, int>&)'
         { return bool(_M_comp(*__it1, *__it2)); }
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/6/string:48:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_function.h:375:7: note: candidate: bool std::greater<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = int]
       operator()(const _Tp& __x, const _Tp& __y) const
       ^~~~~~~~
/usr/include/c++/6/bits/stl_function.h:375:7: note:   no known conversion for argument 1 from 'std::pair<int, int>' to 'const int&'
In file included from /usr/include/c++/6/bits/stl_algobase.h:71:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = std::pair<int, int>; _Iterator = std::pair<int, int>*; _Compare = std::greater<int>]':
/usr/include/c++/6/bits/stl_algo.h:1825:20:   required from 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = std::pair<int, int>*; _Compare = __gnu_cxx::__ops::_Val_comp_iter<std::greater<int> >]'
/usr/include/c++/6/bits/stl_algo.h:1852:36:   required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = std::pair<int, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<std::greater<int> >]'
/usr/include/c++/6/bits/stl_algo.h:1882:25:   required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = std::pair<int, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<std::greater<int> >]'
/usr/include/c++/6/bits/stl_algo.h:1968:31:   required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = std::pair<int, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<std::greater<int> >]'
/usr/include/c++/6/bits/stl_algo.h:4739:18:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = std::pair<int, int>*; _Compare = std::greater<int>]'
/in/foo.cc:10:31:   required from here
/usr/include/c++/6/bits/predefined_ops.h:173:11: error: no match for call to '(std::greater<int>) (std::pair<int, int>&, std::pair<int, int>&)'
  { return bool(_M_comp(__val, *__it)); }
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/6/string:48:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_function.h:375:7: note: candidate: bool std::greater<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = int]
       operator()(const _Tp& __x, const _Tp& __y) const
       ^~~~~~~~
/usr/include/c++/6/bits/stl_function.h:375:7: note:   no known conversion for argument 1 from 'std::pair<int, int>' to 'const int&'
In file included from /usr/include/c++/6/bits/stl_algobase.h:71:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = std::pair<int, int>*; _Value = std::pair<int, int>; _Compare = std::greater<int>]':
/usr/include/c++/6/bits/stl_heap.h:129:48:   required from 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = std::pair<int, int>*; _Distance = long int; _Tp = std::pair<int, int>; _Compare = __gnu_cxx::__ops::_Iter_comp_val<std::greater<int> >]'
/usr/include/c++/6/bits/stl_heap.h:230:23:   required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = std::pair<int, int>*; _Distance = long int; _Tp = std::pair<int, int>; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<std::greater<int> >]'
/usr/include/c++/6/bits/stl_heap.h:335:22:   required from 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = std::pair<int, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<std::greater<int> >]'
/usr/include/c++/6/bits/stl_algo.h:1669:23:   required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = std::pair<int, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<std::greater<int> >]'
/usr/include/c++/6/bits/stl_algo.h:1930:25:   required from 'void std::__partial_sor

信息

递交者
类型
递交
题目
P2163 饥饿的牛
比赛
2024.8.3暑期高级2班练习 记忆化搜索改DP
语言
C++
递交时间
2024-08-04 16:20:17
评测时间
2024-08-04 16:20:17
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes