标签:== 包含 tac style nbsp public int class cto
1 class Solution { 2 public: 3 void push(int value) { 4 q.push(value); 5 if(res.empty() || res.back()>value) res.push_back(value); 6 } 7 void pop() { 8 if(q.empty()) return; 9 if(q.top()==res.back()) res.pop_back(); 10 q.pop(); 11 } 12 int top() { 13 return q.top(); 14 } 15 int min() { 16 return res.back(); 17 } 18 private: 19 stack<int> q; 20 vector<int> res; 21 };
标签:== 包含 tac style nbsp public int class cto
原文地址:https://www.cnblogs.com/pacino12134/p/11143312.html