Problem minstack
User lijia1
Submission Time 2023-07-18 09:40:30
Score 0
Max Time N/A
Max Memory N/A

Compile Error

minstack.cpp:1:1: error: ‘stack’ does not name a type
1 | stack<int> s;
| ^~~~~
minstack.cpp:2:1: error: ‘stack’ does not name a type
2 | stack<int> mins;
| ^~~~~
minstack.cpp: In function ‘void push(int)’:
minstack.cpp:5:2: error: ‘s’ was not declared in this scope
5 | s.push(X);
| ^
minstack.cpp:6:6: error: ‘mins’ was not declared in this scope
6 | if (mins.empty())
| ^~~~
minstack.cpp:12:18: error: ‘min’ was not declared in this scope
12 | int minimum = min(mins.top(), X);
| ^~~
minstack.cpp: In function ‘void pop()’:
minstack.cpp:18:2: error: ‘s’ was not declared in this scope
18 | s.pop();
| ^
minstack.cpp:19:2: error: ‘mins’ was not declared in this scope
19 | mins.pop();
| ^~~~
minstack.cpp: In function ‘int top()’:
minstack.cpp:23:9: error: ‘s’ was not declared in this scope
23 | return s.to