Problem candymountain_ex
User dragons
Submission Time 2023-02-04 01:03:28
Score 0
Max Time N/A
Max Memory N/A

Compile Error

candymountain_ex.cpp: In function ‘int main()’:
candymountain_ex.cpp:56:45: error: no matching function for call to ‘max(int, long long int)’
56 | int mn = query(1, 0, n, max(0, i - k), i - 1);
| ^
In file included from /usr/include/c++/9/algorithm:61,
from candymountain_ex.cpp:1:
/usr/include/c++/9/bits/stl_algobase.h:222:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)’
222 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/9/bits/stl_algobase.h:222:5: note: template argument deduction/substitution failed:
candymountain_ex.cpp:56:45: note: deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘long long int’)
56 | int mn = query(1, 0, n, max(0, i - k), i - 1);
| ^
In file included from /usr/include/c++/9/algorithm:61,