标签:pop erase void oid val int min code 包含
class Solution {
private:
vector<int> vec;
public:
void push(int value) {
vec.emplace_back(value);
}
void pop() {
if(vec.empty()) return;
vec.erase(vec.end()-1);
}
int top() {
if(vec.empty()) return 0;
return *(vec.end()-1);
}
int min() {
if(vec.empty()) return 0;
return *min_element(vec.begin(), vec.end());
}
};
标签:pop erase void oid val int min code 包含
原文地址:https://www.cnblogs.com/theodoric008/p/9537800.html