记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:28:13: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)'
   28 |         sort(b.begin, b.end);
      |         ~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12/algorithm:61,
                 from /in/foo.cc:3:
/usr/include/c++/12/bits/stl_algo.h:4810:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4810 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/12/bits/stl_algo.h:4810:5: note:   template argument deduction/substitution failed:
/in/foo.cc:28:13: note:   couldn't deduce template parameter '_RAIter'
   28 |         sort(b.begin, b.end);
      |         ~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/stl_algo.h:4841:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4841 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/12/bits/stl_algo.h:4841:5: note:   template argument deduction/substitution failed:
/in/foo.cc:28:13: note:   candidate expects 3 arguments, 2 provided
   28 |         sort(b.begin, b.end);
      |         ~~~~^~~~~~~~~~~~~~~~

信息

递交者
类型
自测
题目
4 排序中的交换次数
语言
C++
递交时间
5 小时前
评测时间
5 小时前
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes