Problem potatosalad
User Ast8ine
Submission Time 2026-02-16 13:23:01
Score 0
Max Time N/A
Max Memory N/A

Compile Error

potatosalad.cpp: In function ‘int main()’:
potatosalad.cpp:16:56: error: no matching function for call to ‘max_element(std::vector<int>::iterator, <unresolved overloaded function type>)’
16 | auto max_ptr = max_element(potato.begin(), potato.end));
| ^
In file included from /usr/include/c++/9/algorithm:62,
from potatosalad.cpp:3:
/usr/include/c++/9/bits/stl_algo.h:5713:5: note: candidate: ‘constexpr _FIter std::max_element(_FIter, _FIter) [with _FIter = __gnu_cxx::__normal_iterator<int*, std::vector<int> >]’
5713 | max_element(_ForwardIterator __first, _ForwardIterator __last)
| ^~~~~~~~~~~
/usr/include/c++/9/bits/stl_algo.h:5713:60: note: no known conversion for argument 2 from ‘<unresolved overloaded function type>’ to ‘__gnu_cxx::__normal_iterator<int*, std::vector<int> >’
5713 | max_element(_ForwardIterator