Problem lengthsort
User AltheaZ
Submission Time 2023-06-30 12:48:01
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lengthsort.cpp: In function ‘int main()’:
lengthsort.cpp:18:21: error: no matching function for call to ‘std::vector<std::__cxx11::basic_string<char> >::erase(int&)’
18 | words.erase(maxele);
| ^
In file included from /usr/include/c++/9/vector:67,
from lengthsort.cpp:2:
/usr/include/c++/9/bits/stl_vector.h:1427:7: note: candidate: ‘std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::const_iterator) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; typename std::_Vector_base<_Tp, _Alloc>::pointer = std::__cxx11::basic_string<char>*; std::vector<_Tp, _Alloc>::const_iterator = __gnu_cxx