Problem exam
User Ast8ine
Submission Time 2026-02-14 11:44:07
Score 0
Max Time N/A
Max Memory N/A

Compile Error

exam.cpp: In function ‘int main()’:
exam.cpp:9:22: error: no matching function for call to ‘clamp(long long int&, int, int)’
9 | n1 = clamp(n1, 0, 9);
| ^
In file included from /usr/include/c++/9/algorithm:62,
from exam.cpp:2:
/usr/include/c++/9/bits/stl_algo.h:3719:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::clamp(const _Tp&, const _Tp&, const _Tp&)’
3719 | clamp(const _Tp& __val, const _Tp& __lo, const _Tp& __hi)
| ^~~~~
/usr/include/c++/9/bits/stl_algo.h:3719:5: note: template argument deduction/substitution failed:
exam.cpp:9:22: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘int’)
9 | n1 = clamp(n1, 0, 9);
| ^
In file included from /usr/include/c++/9/algorithm:62,
from exam.cpp:2:
/usr/include/c++/9/bits/stl_algo.h:3737:5: note: candidate: ‘template<class