OJ算法-动态规划
文章平均质量分 72
BraveLii
这个作者很懒,什么都没留下…
展开
-
动态规划-查找最长递增子序列的长度
1、最长连续子序列的长度Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray).Example 1:Input: [1,3,5,4,7]Output: 3Explanation: The longest continuous incr...原创 2018-04-01 00:40:32 · 385 阅读 · 0 评论 -
动态规划-小强的暑假做业务
题目临近开学了,大家都忙着收拾行李准备返校,但小强却不为此担心! 因为他的心思全在暑假作业上:目前为止还未开动(-_-!!还以为他有多冷静呢)。暑假作业是很多张试卷,我们这些从试卷里爬出来的人都知道,卷子上的题目有选择题、填空题、简答题、证明题等。而做选择题的好处就在于工作量很少,但又因为选择题题目都普遍很长。 如果有5张试卷,其中4张是选择题,最后一张是填空题,很明显做最后一张所花的时间要比前4...原创 2018-04-04 00:16:34 · 628 阅读 · 0 评论 -
动态规划-两个字符串的最长公共子串
如题,待补充原创 2018-04-03 23:20:48 · 329 阅读 · 0 评论 -
动态规划-开心的小明
小明今天很开心,家里购置的新房就要领钥匙了,新房里有一间他自己专用的很宽敞的房间。更让他高兴的是,妈妈昨天对他说:“你的房间需要购买哪些物品,怎么布置,你说了算,只要不超过N元钱就行”。今天一早小明就开始做预算,但是他想买的东西太多了,肯定会超过妈妈限定的N元。于是,他把每件物品规定了一个重要度,分为5等:用整数1~5表示,第5等最重要。他还从因特网上查到了每件物品的价格(都是整数元)。他希望在不...原创 2018-04-04 16:53:28 · 909 阅读 · 0 评论 -
动态规划-查找最长递增子数列的数目
Given an unsorted array of integers, find the number of longest increasing subsequence.Example 1:Input: [1,3,5,4,7]Output: 2Explanation: The two longest increasing subsequence are [1, 3, 4, 7] and [...原创 2018-04-22 22:43:29 · 607 阅读 · 0 评论 -
LeetCode 198. House Robber
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house...原创 2018-04-28 12:53:12 · 161 阅读 · 0 评论