Problem minstack
User havinaaaaash
Submission Time 2025-02-14 08:51:47
Score 0
Max Time N/A
Max Memory N/A

Compile Error

minstack.cpp: In function ‘void push(int)’:
minstack.cpp:13:16: error: ‘minVal’ was not declared in this scope
13 | s.push({X, minVal});
| ^~~~~~
minstack.cpp:13:23: error: no matching function for call to ‘std::stack<std::pair<int, int> >::push(<brace-enclosed initializer list>)’
13 | s.push({X, minVal});
| ^
In file included from /usr/include/c++/9/stack:61,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:89,
from minstack.cpp:1:
/usr/include/c++/9/bits/stl_stack.h:233:7: note: candidate: ‘void std::stack<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<int, int>; _Sequence = std::deque<std::pair<int, int>, std::allocator<std::pair<int, int> > >; std::stack<_Tp, _Sequence>::value_type = std::pair<int, int>]’
233 | push(const value_type& __x)
| ^~~~