Problem minstack
User carson
Submission Time 2026-02-18 09:48:06
Score 0
Max Time N/A
Max Memory N/A

Compile Error

minstack.cpp:4:1: error: ‘stack’ does not name a type; did you mean ‘obstack’?
4 | stack<ll> s;
| ^~~~~
| obstack
minstack.cpp:5:1: error: ‘stack’ does not name a type; did you mean ‘obstack’?
5 | stack<ll> min;
| ^~~~~
| obstack
minstack.cpp: In function ‘void push(int)’:
minstack.cpp:8:2: error: ‘s’ was not declared in this scope
8 | s.push(x);
| ^
minstack.cpp:9:9: error: ‘min’ was not declared in this scope; did you mean ‘std::min’?
9 | if(x > min.top()){
| ^~~
| std::min
In file included from /usr/include/c++/9/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
from minstack.cpp:1:
/usr/include/c++/9/bits/stl_algo.h:3456:5: note: ‘std::min’ declared here
3456 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
minstack.cpp: In function ‘void pop(