Problem minstack
User ashgreninja1006
Submission Time 2025-07-12 19:44:07
Score 0
Max Time N/A
Max Memory N/A

Compile Error

minstack.cpp:3:1: error: ‘stack’ does not name a type; did you mean ‘obstack’?
3 | stack<int> s;
| ^~~~~
| obstack
minstack.cpp:4:1: error: ‘stack’ does not name a type; did you mean ‘obstack’?
4 | stack<int> min;
| ^~~~~
| obstack
minstack.cpp: In function ‘void push(int)’:
minstack.cpp:9:2: error: ‘s’ was not declared in this scope
9 | s.push(X);
| ^
minstack.cpp:11:7: error: overloaded function with no contextual type information
11 | min.push(X);
| ^~~~
minstack.cpp:14:7: error: overloaded function with no contextual type information
14 | min.push(s.top());
| ^~~~
minstack.cpp: In function ‘void pop()’:
minstack.cpp:19:2: error: ‘s’ was not declared in this scope
19 | s.pop();
| ^
minstack.cpp:20:6: error: overloaded function with no contextual type information
20 | min.pop();
| ^~~
minstack.cp