摘要: class Solution {public: int maximalRectangle(vector<vector<char> > &matrix) { if (matrix.empty()) { return 0; } int n = matrix[0].size(); vector<int> H(n); vector<int> L(n); vector<int> R(n, n); int ret = 0; for (int i = 0; i < ma... 阅读全文
posted @ 2013-05-31 22:24 代码改变未来 阅读(953) 评论(0) 推荐(0) 编辑
摘要: Iclass Solution {public: int maxProfit(vector<int> &prices) { if(prices.size()==0||prices.size()==1)return 0; int min=prices[0]; int max=prices[0]; int diff=0; for(int i=1;i<prices.size();i++) { if(prices[i]<min)min=prices[i]; ... 阅读全文
posted @ 2013-05-31 14:37 代码改变未来 阅读(146) 评论(0) 推荐(0) 编辑