题目链接: "HDU 1392" Problem Description There are a lot of trees in an area. A peasant wants to buy a rope to surround all these trees. So at first he mu ...
分类:
其他好文 时间:
2019-08-17 00:46:44
阅读次数:
87
Ekka and his friend Dokka decided to buy a cake. They both love cakes and that's why they want to share the cake after buying it. As the name suggeste ...
分类:
其他好文 时间:
2019-08-12 23:43:21
阅读次数:
96
Algorithms: https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/ Review: “How to write a good software design doc” by Angela Zhang https: ...
分类:
其他好文 时间:
2019-08-11 22:56:36
阅读次数:
117
//手写异步// 在js中只要看到异步首先想到回调函数,将后续要做的事传入当前要做的事里面,当前的事做好后开始做后面的事function buy(callback) { setTimeout(function () { var a="我做完饭了"; callback(a); },2000)}buy(... ...
分类:
其他好文 时间:
2019-08-11 17:21:27
阅读次数:
102
problem:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/ 这道题有好几个变种。对于没有cooldown的题目而言,只需要考虑第i天,当前持有股票的最大收益和当前不持有股票的最大收益。而引入 ...
分类:
其他好文 时间:
2019-08-04 19:45:14
阅读次数:
81
problem:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/ 维护两个状态,一个是当前持有股票状态,一个是当前不持有股票状态,两者分别计算最大值。 在第i天,如果当天不持有股票, ...
分类:
其他好文 时间:
2019-08-04 19:36:31
阅读次数:
89
题意 买股票,中间买卖完一次后必须休息一下,求最大收益 题解 建议观看视频 https://www.bilibili.com/video/av31578180 状态转移图 buy[i] 代表当前持有股票的最大收益 sell[i] 代表当前卖出股票的最大收益 rest[i] 代表当前休息的最大收益 c ...
分类:
其他好文 时间:
2019-08-04 18:03:54
阅读次数:
86
基于Typecho的一个全新版个人博客小程序 Typecho下载地址:http://typecho.org/ 且支持https服务,如果没有可以免费申请一下。 阿里云ssl免费申请:https://common-buy.aliyun.com/?spm=5176.7968328.1266638..57... ...
分类:
其他好文 时间:
2019-08-02 20:57:42
阅读次数:
346
Best Time to Buy and Sell Stock II Best Time to Buy and Sell Stock III 比较难想到,分别记录四个状态: 1buy,1buy1sell,2buy1sell,2buy2sell。 构建四个dp数组,例如,1buy1sell[i] = ...
分类:
其他好文 时间:
2019-07-28 13:54:19
阅读次数:
77
Stancu likes space travels but he is a poor software developer and will never be able to buy his own spacecraft. That is why he is preparing to steal ...
分类:
其他好文 时间:
2019-07-13 12:07:28
阅读次数:
109