/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:19:16: error: no matching function for call to 'sort(int [101], int, bool (&)(int, int))'
  sort(a,n+1,cmp);
                ^
In file included from /usr/include/c++/6/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:65,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_algo.h:4697:5: note: candidate: template<class _RAIter> void std::sort(_RAIter, _RAIter)
     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
     ^~~~
/usr/include/c++/6/bits/stl_algo.h:4697:5: note:   template argument deduction/substitution failed:
/in/foo.cc:19:16: note:   deduced conflicting types for parameter '_RAIter' ('int*' and 'int')
  sort(a,n+1,cmp);
                ^
In file included from /usr/include/c++/6/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:65,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_algo.h:4727:5: note: candidate: template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)
     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
     ^~~~
/usr/include/c++/6/bits/stl_algo.h:4727:5: note:   template argument deduction/substitution failed:
/in/foo.cc:19:16: note:   deduced conflicting types for parameter '_RAIter' ('int*' and 'int')
  sort(a,n+1,cmp);
                ^
/in/foo.cc:16:6: warning: unused variable 'mu' [-Wunused-variable]
  int mu;
      ^~
/in/foo.cc:17:6: warning: unused variable 'zuo' [-Wunused-variable]
  int zuo;
      ^~~
/in/foo.cc:18:6: warning: unused variable 'you' [-Wunused-variable]
  int you;
      ^~~

信息

递交者
类型
递交
题目
P1911 珠心算测验
语言
C++
递交时间
2024-11-07 11:46:57
评测时间
2024-11-07 11:46:57
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes