Problem reverse
User SY
Submission Time 2025-06-18 09:28:58
Score 0
Max Time N/A
Max Memory N/A

Compile Error

reverse.cpp: In function ‘int main()’:
reverse.cpp:9:17: error: no matching function for call to ‘std::stack<long long int>::stack(long long int&)’
9 | stack<int> st(n);
| ^
In file included from /usr/include/c++/9/stack:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:89,
from reverse.cpp:1:
/usr/include/c++/9/bits/stl_stack.h:185:2: note: candidate: ‘template<class _Alloc, class _Requires> std::stack<_Tp, _Sequence>::stack(std::stack<_Tp, _Sequence>&&, const _Alloc&)’
185 | stack(stack&& __q, const _Alloc& __a)
| ^~~~~
/usr/include/c++/9/bits/stl_stack.h:185:2: note: template argument deduction/substitution failed:
reverse.cpp:9:17: note: candidate expects 2 arguments, 1 provided
9 | stack<int> st(n);
| ^
In file included from /usr/include/c++/9/stack:61,
from /usr/include/x86_