![](https://img-blog.csdnimg.cn/2019092715111047.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
DP
文章平均质量分 75
DP
Marx_W
这个作者很懒,什么都没留下…
展开
-
HDU——1069 Monkey and Banana(DP)
Problem DescriptionA group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monkey with som...原创 2018-04-23 17:14:59 · 159 阅读 · 0 评论 -
HDU——1159 Common Subsequence(DP 最长公共子序列)
Problem Description A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, …, xm> another sequence Z = < z1,...原创 2018-05-06 16:05:41 · 248 阅读 · 0 评论 -
POJ——1050 To the Max(DP + 最大 矩阵和/子段和)
DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the whole array. The sum of a rectangle ...原创 2018-05-05 18:35:56 · 191 阅读 · 0 评论 -
HDU——1987 How Many Ways(记忆化搜索 + dp)
Problem Description这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下: 1.机器人一开始在棋盘的起始点并有起始点所标有的能量。 2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。 3.机器人不能在原地停留。 4.当机器人选择了一条可行路径后,当他走到这条路径的终点时,他将只有终点所标记的能量。 ...原创 2018-05-02 20:17:01 · 173 阅读 · 0 评论 -
动态规划——数塔问题
题目:如图一个数塔,从顶部出发在每一个节点可以选择向左或者向右走,一直走到最底层,找出一条路径,使得路径上的数字之和最大. 思路分析: 误区:看到这个题第一个想法就是使用贪婪算法,从而得到的结果是9->15->8->9->10.然而这道题目的正确结果应该是9->12->10->18->10.所以不能使用贪婪算法来求解这条题目。思路:在用动态规划考虑数塔问题时可以从下往上计算。 从原创 2017-03-31 23:10:41 · 11272 阅读 · 0 评论 -
动态规划——投资问题
要求:现有X万元资金可以投资给m个项目,先给出三个项目分别投资0~X万元可得的利益,其求出如何分配这X万元可以使得得到的利益最大化。 (本题以投资金额为7万元资金以及A、B、C三个项目为例) 解题思路: 这道题目是分成的项目是三个,所以可以将整个解题思路分为三个阶段。 第一阶段:只考虑A一个项目,即将所有的资金都投资给A,那么此时可以获取的利益就是: 第原创 2017-04-06 20:46:49 · 16636 阅读 · 1 评论 -
动态规划——状态压缩
转自:http://blog.csdn.net/lu597203933/article/details/44137277(本文中加了一些自己的理解)题目这个题目的题意很容易理解,在一个N*M的格子里,我们现在有两种类型的砖块,1 * 2和 2 * 1,问一共有多少种方案,可以将整个N*M的空间都填满。最简单的例子就是下面的了: 编程之美中题目:某年夏天,位于希格玛大厦四层的微...转载 2018-03-11 17:28:36 · 558 阅读 · 0 评论 -
HDU——1074 Doing homework (动态规划——状态压缩)
Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in ...原创 2018-03-13 19:51:32 · 324 阅读 · 0 评论 -
HDU——1078 Fatmouse and cheese(记忆搜索 + 动态规划)
Problem DescriptionFatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0 <= q &l...原创 2018-03-13 20:05:00 · 320 阅读 · 0 评论 -
HDU——1176 免费馅饼(动态规划 类似数塔问题)
Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中是个...原创 2018-03-20 19:09:54 · 322 阅读 · 0 评论 -
HDU——1203 I need a offer(dp)
Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Speakless估计了他得...原创 2018-03-29 19:23:20 · 128 阅读 · 0 评论 -
动态规划——最长公共子序列
**转自:https://blog.csdn.net/hrn1216/article/details/51534607 原作者:Running07** 过程可以说是讲的非常清楚了!!!!1.基本概念 首先需要科普一下,最长公共子序列(longest common sequence)和最长公共子串(longest common substring)不是一回事儿。什么是子序列呢?即一个给...转载 2018-03-31 21:42:41 · 205 阅读 · 0 评论 -
HDU——1003 Max Sum(dp 最大子段和 !!)
Problem DescriptionGiven a sequence a[1],a[2],a[3]……a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 =...原创 2018-04-03 20:40:06 · 161 阅读 · 0 评论 -
HDU——1087 Super Jumping!Jumping!Jumping!(dp 递增子序列最大和)
Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to yo...原创 2018-04-08 16:55:57 · 376 阅读 · 0 评论 -
HDU——1160 FatMouse's Speed(DP 最长递增/减子序列)
Problem DescriptionFatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as pos...原创 2018-05-07 16:52:28 · 340 阅读 · 0 评论