![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
动态规划(dp)
DP
Learning_is_endless
天道酬勤 功到自成
展开
-
简单dp,hdoj2084(数塔)
数塔Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗? Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1 <= N <= 100),表示数塔的高...原创 2017-07-22 21:15:51 · 236 阅读 · 0 评论 -
Coprime Sequence HDU - 6025
Coprime Sequence HDU - 6025 Do you know what is called ``Coprime Sequence''? That is a sequence consists of nn positive integers, and the GCD (Greatest Common Divisor) of them is equal to 1. ``Coprime...原创 2018-04-29 21:50:16 · 196 阅读 · 0 评论 -
Working out (dp动态规划)
Working out Summer is coming! It's time for Iahub and Iahubina to work out, as they both want to look hot at the beach. The gym where they go is a matrix a with n lines and m columns. Let number a[i]...原创 2018-03-20 19:57:31 · 974 阅读 · 0 评论 -
完全背包
完全背包 John never knew he had a grand-uncle, until he received the notary's letter. He learned that his late grand-uncle had gathered a lot of money, somewhere in South-America, and that John was the on...原创 2018-03-24 11:54:38 · 169 阅读 · 0 评论 -
最长上升子序列 HDU - 1257
A - 最长上升子序列 HDU - 1257某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹. ...转载 2018-03-14 19:16:49 · 137 阅读 · 0 评论 -
Super Jumping! Jumping! Jumping! HDU - 1087(dp,上升子串求最大和)
Super Jumping! Jumping! Jumping! HDU - 1087Nowadays, 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原创 2017-12-07 21:57:46 · 329 阅读 · 0 评论 -
Cash Machine POJ - 1276 (多重背包(模板))
Cash Machine POJ - 1276 A Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactl原创 2017-11-21 22:07:41 · 275 阅读 · 0 评论 -
滑雪 POJ - 1088 (记忆化搜索)
滑雪 POJ - 1088 Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 516 17 18 19 615 24 25原创 2017-11-29 20:53:57 · 532 阅读 · 0 评论 -
Common Subsequence HDU - 1159 (最长公共子序列)
Common SubsequenceHDU - 1159A 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 = &l...原创 2017-11-05 11:40:39 · 280 阅读 · 0 评论 -
完全背包 Piggy-Bank HDU - 1114
Piggy-Bank HDU - 1114 Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Mone原创 2017-10-16 16:37:18 · 234 阅读 · 0 评论 -
01背包 Bone Collector HDU - 2602
Bone Collector HDU - 2602 Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he w原创 2017-10-16 19:35:59 · 153 阅读 · 0 评论 -
01背包简讲(这个表很清晰)
github地址:https://github.com/arkulo56/thought/blob/master/software/algorithm/%E7%AE%97%E6%B3%95---01%E8%83%8C%E5%8C%85%E9%97%AE%E9%A2%98.md有编号为a、b、c、d、e的5件物品,他们的重量分别是2、2、6、5、4,他们的价值分别是6、3、5、4、6转载 2017-10-16 19:47:33 · 528 阅读 · 0 评论 -
悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 HDU - 2191 (多重背包)
悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 HDU - 2191 急!灾区的食物依然短缺! 为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。 请问:你用有限的资金最多能采购多少公斤粮食呢? 后记: 人生是一个充满了变数的生命过程,原创 2017-10-25 21:02:13 · 168 阅读 · 0 评论 -
Robberies HDU - 2955 (01背包!)
Robberies HDU - 2955 The aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become too greedy. He has原创 2017-10-31 17:03:30 · 203 阅读 · 0 评论 -
最多拦截导弹数 NBUT - 1082
最多拦截导弹数 NBUT - 1082 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统。但是这种导弹拦截系统有一个缺陷:虽然它能拦截任意高度的导弹,但是每拦截一发导弹,其拦截能力就 下降到只能拦截上一次拦截的导弹高度。某天,雷达捕捉到敌国的导弹来袭,导弹依次飞来,该拦截系统最多能拦截多少导弹呢? Input输入若干组数据。每组数据包括:导弹总个数(正整数Outp原创 2017-11-06 20:33:02 · 454 阅读 · 0 评论 -
Building Shops HDU - 6024
Building Shops HDU - 6024HDU’s nn classrooms are on a line ,which can be considered as a number line. Each classroom has a coordinate. Now Little Q wants to build several candy shops in these nn class...原创 2018-04-29 22:36:20 · 143 阅读 · 0 评论