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

Compile Error

exam.cpp: In function ‘int main()’:
exam.cpp:8:27: error: no matching function for call to ‘clamp(long long int&, int, int)’
8 | n1 = std::clamp(n1, 1, 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:8:27: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘int’)
8 | n1 = std::clamp(n1, 1, 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: