Problem minstack
User kaien
Submission Time 2024-12-11 15:02:38
Score 0
Max Time N/A
Max Memory N/A

Compile Error

minstack.cpp:1:1: error: ‘vector’ does not name a type
1 | vector<int> v;
| ^~~~~~
minstack.cpp: In function ‘void push(int)’:
minstack.cpp:4:2: error: ‘v’ was not declared in this scope
4 | v.push_back(X);
| ^
minstack.cpp: In function ‘void pop()’:
minstack.cpp:8:2: error: ‘v’ was not declared in this scope
8 | v.pop_back();
| ^
minstack.cpp: In function ‘int top()’:
minstack.cpp:12:9: error: ‘v’ was not declared in this scope
12 | return v.back();
| ^
minstack.cpp: In function ‘int getMin()’:
minstack.cpp:16:10: error: ‘INT_MAX’ was not declared in this scope
16 | int m = INT_MAX;
| ^~~~~~~
minstack.cpp:1:1: note: ‘INT_MAX’ is defined in header ‘<climits>’; did you forget to ‘#include <climits>’?
+++ |+#include <climits>
1 | vector<int> v;
minstack.cpp:17:14: error: ‘v’ was not declared in this scope
17 |