Problem minstack
User duck
Submission Time 2025-12-12 09:10:13
Score 0
Max Time N/A
Max Memory N/A

Compile Error

minstack.cpp:3:1: error: ‘vector’ does not name a type
3 | vector<int> v;
| ^~~~~~
minstack.cpp:4:1: error: ‘vector’ does not name a type
4 | vector<int> minm;
| ^~~~~~
minstack.cpp: In function ‘void push(int)’:
minstack.cpp:6:2: error: ‘v’ was not declared in this scope
6 | v.push_back(x);
| ^
minstack.cpp:7:6: error: ‘minm’ was not declared in this scope
7 | if (minm.empty()) {
| ^~~~
minstack.cpp:10:22: error: ‘min’ was not declared in this scope; did you mean ‘std::min’?
10 | else minm.push_back(min(minm.back(), x));
| ^~~
| 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:2:
/usr/include/c++/9/bits/stl_algo.h:3456:5: note: ‘std::min’ declared here
3456 | min(initializer_lis