Problem minstack
User idkhowtocode
Submission Time 2026-03-04 21:06:29
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> k={INT_MAX};
| ^~~~~~
minstack.cpp: In function ‘void push(int)’:
minstack.cpp:6:5: error: ‘v’ was not declared in this scope
6 | v.push_back(x);
| ^
minstack.cpp:7:5: error: ‘k’ was not declared in this scope
7 | k.push_back(min(x,k.back()));
| ^
minstack.cpp:7:17: error: ‘min’ was not declared in this scope; did you mean ‘std::min’?
7 | k.push_back(min(x,k.back()));
| ^~~
| 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:1:
/usr/include/c++/9/bits/stl_algo.h:3456:5: note: ‘std::min’ declared here
3456 | min(initializer_list