Problem shoop
User Random52
Submission Time 2024-12-02 16:46:56
Score 0
Max Time N/A
Max Memory N/A

Compile Error

shoop.cpp: In function ‘int main()’:
shoop.cpp:45:41: error: no matching function for call to ‘max(__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type, int)’
45 | if (x - (std::max(c[i] - disc, 0)) >= 0) {
| ^
In file included from /usr/include/c++/9/algorithm:61,
from shoop.cpp:3:
/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:
shoop.cpp:45:41: note: deduced conflicting types for parameter ‘const _Tp’ (‘long int’ and ‘int’)
45 | if (x - (std::max(c[i] - disc, 0)) >= 0) {
| ^
In file included from /usr/include/c++/9/al