Problem minstack
User John
Submission Time 2025-03-08 11:06:42
Score 0
Max Time N/A
Max Memory N/A

Compile Error

minstack.cpp:3:1: error: ‘stack’ does not name a type
3 | stack<int> s;
| ^~~~~
minstack.cpp:4:1: error: ‘multiset’ does not name a type
4 | multiset<int> ms;
| ^~~~~~~~
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:10:2: error: ‘ms’ was not declared in this scope
10 | ms.insert(X);
| ^~
minstack.cpp: In function ‘void pop()’:
minstack.cpp:13:2: error: ‘ms’ was not declared in this scope
13 | ms.erase(ms.find(s.top()));
| ^~
minstack.cpp:13:19: error: ‘s’ was not declared in this scope
13 | ms.erase(ms.find(s.top()));
| ^
minstack.cpp: In function ‘int top()’:
minstack.cpp:18:9: error: ‘s’ was not declared in this scope
18 | return s.top();
| ^
minstack.cpp: In function ‘int getMin()’:
minstack.cpp:22:10: error: ‘