Problem lengthsort
User Hytoh
Submission Time 2023-05-03 20:04:20
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lengthsort.cpp: In function ‘int main()’:
lengthsort.cpp:23:59: error: no matching function for call to ‘stable_sort(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, std::greater<int>, bool (&)(std::string, std::string))’
23 | stable_sort(v.begin(), v.end(),greater<int>(), compare);
| ^
In file included from /usr/include/c++/9/algorithm:62,
from lengthsort.cpp:2:
/usr/include/c++/9/bits/stl_algo.h:5068:5: note: candidate: ‘template<class _RAIter> void std::stable_sort(_RAIter, _RAIter)’
5068 | stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~~~~~~~~
/usr/include/c++/9/bits/stl_algo.h:5068:5: note: template argument deduction/substitution failed:
lengthsort.cpp:23:59: note: candidate expects 2 arguments, 4 provided<