上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 45 下一页
摘要: 695. 岛屿的最大面积 class Solution { public: int maxAreaOfIsland(vector<vector<int>>& grid) { int hh=grid.size();//行 int ll=grid[0].size();//列 if(hh==0) retu 阅读全文
posted @ 2020-06-14 22:57 branna 阅读(213) 评论(0) 推荐(0)
摘要: 901. 股票价格跨度 class StockSpanner { public: StockSpanner() { } int next(int price) { int d=1; while(!value.empty()&&price>=value.top())//价格栈不为空且当前的价格大于等于 阅读全文
posted @ 2020-06-13 22:07 branna 阅读(165) 评论(0) 推荐(0)
摘要: 面试题63. 股票的最大利润 class Solution { public: int maxProfit(vector<int>& prices) { if(prices.size()<=1) return 0; int ans=prices[0]; int ans1=0; for(int i=1 阅读全文
posted @ 2020-06-13 22:05 branna 阅读(152) 评论(0) 推荐(0)
摘要: 309. 最佳买卖股票时机含冷冻期 解释见代码: class Solution { public: int maxProfit(vector<int>& prices) { if(prices.size()<=1) return 0; int dp[prices.size()+10][3];//第一 阅读全文
posted @ 2020-06-09 13:52 branna 阅读(178) 评论(0) 推荐(0)
摘要: 题目链接:http://codeforces.com/contest/1362 简单讲解:https://www.bilibili.com/video/BV15C4y1a7e5 A - Johnny and Ancient Computer // // main.cpp // CF // // Cr 阅读全文
posted @ 2020-06-05 12:37 branna 阅读(284) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 45 下一页