Problem lengthsort
User Jasper123
Submission Time 2026-05-30 09:10:25
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lengthsort.cpp: In function ‘int main()’:
lengthsort.cpp:16:25: error: no match for ‘operator<<’ (operand types are ‘const value_type’ {aka ‘const std::__cxx11::basic_string<char>’} and ‘<unresolved overloaded function type>’)
16 | int a = pq.top()<<std::endl;
| ~~~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/9/bits/basic_string.h:48,
from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from lengthsort.cpp:1:
/usr/include/c++/9/string_view:580:5: note: candidate: ‘template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream