动态规划
三粉咩
这个作者很懒,什么都没留下…
展开
-
顺序表应用8:最大子段和之动态规划法
好吧,昨晚经过同学的批评,我觉得自己确实违背了初心,开始走向没落; 所以今天好好发一次博客; 今天这道题是动态规划的一道;动态规划的思想是全局状态下的最优解,个人见解是要找出相似子结构,每一个子结构存储当前状态,下一个子结构直接使用上一个状态。 这道题是很狗的,因为我总以为他会超时,因为我本来想使用两层for循环遍历,但其实只需要一趟for循环,因为每个子结构(前缀合)不能为负数,如果为负数原创 2018-01-27 17:10:49 · 758 阅读 · 0 评论 -
小P的故事——神奇的换零钱
一个完全背包问题; 个人见解:要往一个背包递推式上靠;但总感觉,一个题一个样子,还是个别题个别分析; emmm,总结不出撒赖; 看题吧 Problem Description 已知A国经济很落后,他们只有1、2、3元三种面值的硬币,有一天小P要去A国旅行,想换一些零钱,小P很想知道将钱N兑换成硬币有很多种兑法,但是可惜的是他的数学竟然是体育老师教的,所以他不会啊、、、他只好求助于你,原创 2018-01-27 20:42:36 · 106 阅读 · 0 评论 -
Treats for the Cows &&区间DP
FJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for giving vast amounts of milk. FJ sells one treat per day and wants to maximize the money he receives over a given p...原创 2018-08-22 09:03:42 · 115 阅读 · 0 评论 -
HDU--1078--FatMouse and Cheese--记忆化搜索
转载:https://blog.csdn.net/jingdianitnan/article/details/41546005 在这里致歉:此文章没有经过博主同意私自转载,若博主发现,可在下方评论,与我私聊解决 HDU--1078--FatMouse and Cheese--记忆化搜索 2014年11月27日 15:31:31 阅读数:596更多 个人分类: 深搜DP FatMou...转载 2018-08-22 21:01:32 · 140 阅读 · 0 评论 -
Tickets
Jesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film tickets. He is wandering when could he go back home as early as...原创 2018-08-20 09:14:38 · 197 阅读 · 0 评论 -
FatMouse's Speed
FatMouse 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 possible into a sequence...原创 2018-08-20 10:05:03 · 330 阅读 · 0 评论 -
Common Subsequence
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, z2, ..., zk > is a ...原创 2018-08-20 20:35:15 · 123 阅读 · 0 评论 -
Phalanx HDU - 2859
Today is army day, but the servicemen are busy with the phalanx for the celebration of the 60th anniversary of the PRC. A phalanx is a matrix of size n*n, each element is a character (a~z or A~Z), st...原创 2018-08-24 09:30:17 · 135 阅读 · 0 评论 -
Help Jimmy
"Help Jimmy" 是在下图所示的场景上完成的游戏。 场景中包括多个长度和高度各不相同的平台。地面是最低的平台,高度为零,长度无限。 Jimmy老鼠在时刻0从高于所有平台的某处开始下落,它的下落速度始终为1米/秒。当Jimmy落到某个平台上时,游戏者选择让它向左还是向右跑,它跑动的速度也是1米/秒。当Jimmy跑到平台的边缘时,开始继续下落。Jimmy每次下落的高度不能超过MAX...原创 2018-08-21 11:56:16 · 180 阅读 · 0 评论