
【动态规划】--简单DP
LaoJiu_
这个作者很懒,什么都没留下…
展开
-
hdu1501 Zipper--DP
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1501一:原题内容Problem DescriptionGiven three strings, you are to determine whether the third string can be formed by combining the characters原创 2015-12-27 13:44:46 · 2426 阅读 · 0 评论 -
hdu2830 Matrix Swapping II--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=2830一:原题内容Problem DescriptionGiven an N * M matrix with each entry equal to 0 or 1. We can find some rectangles in the matrix whose entr原创 2016-03-23 15:39:57 · 707 阅读 · 0 评论 -
hdu1257 最少拦截系统--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1257一:原题内容Problem Description某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用原创 2016-03-23 16:13:37 · 1134 阅读 · 0 评论 -
hdu3336 Count the string--KMP+DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=3336一:原题内容Problem DescriptionIt is well known that AekdyCoin is good at string problems as well as number theory problems. When given a原创 2016-03-19 15:50:15 · 747 阅读 · 0 评论 -
hdu1231 最大连续子序列--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1231一:原题内容Problem Description给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ...,Nj },其中 1 例如给定序列{ -2, 11, -4, 13, -5, -2 },其原创 2016-03-19 21:53:40 · 900 阅读 · 0 评论 -
hdu1087 Super Jumping! Jumping! Jumping!--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1087一:原题内容Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe yo原创 2016-03-20 14:06:36 · 629 阅读 · 0 评论 -
hdu1422 重温世界杯--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1422一:原题内容Problem Description世界杯结束了,意大利人连本带利的收回了法国人6年前欠他们的债,捧起了大力神杯,成就了4星意大利.世界杯虽然结束了,但是这界世界杯给我们还是留下许多值得回忆的东西.比如我们听到了黄名嘴的3分钟激情解说,我们懂得了原创 2016-03-27 16:35:08 · 639 阅读 · 0 评论 -
hdu1227 Fast Food--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1227一:原题内容Problem DescriptionThe fastfood chain McBurger owns several restaurants along a highway. Recently, they have decided to build原创 2016-03-28 11:24:52 · 729 阅读 · 0 评论 -
hdu2845 Beans--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=2845一:原题内容Problem DescriptionBean-eating is an interesting game, everyone owns an M*N matrix, which is filled with different qualities b原创 2016-03-22 10:47:39 · 575 阅读 · 0 评论 -
hdu1506 Largest Rectangle in a Histogram--DP/栈
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1506一:原题内容Problem DescriptionA histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles原创 2016-03-22 14:28:11 · 780 阅读 · 0 评论 -
hdu1300 Pearls--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1300一:原题内容Problem DescriptionIn Pearlania everybody is fond of pearls. One company, called The Royal Pearl, produces a lot of jewelry原创 2016-03-27 17:15:19 · 755 阅读 · 0 评论 -
hdu1069 Monkey and Banana--DP
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1069一:原题内容Problem DescriptionA group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the原创 2016-03-20 20:26:44 · 720 阅读 · 0 评论 -
hdu1978 How many ways--DP/记忆化搜索DFS
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1978一:原题内容Problem Description这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下:1.机器人一开始在棋盘的起始点并有起始点所标有的能量。2.机器人只能向右或者向下走,并且每走原创 2016-03-24 17:11:31 · 877 阅读 · 0 评论 -
poj1458 Common Subsequence--最长公共子序列
题目链接:http://poj.org/problem?id=1458dp[i][j]dp[i] [j]表示串s1前i字符和串s2前j字符的最长公共子序列。#include<iostream>#include<string.h>#include<algorithm>using namespace std;int dp[1005][1005];char s1[1005];char s2[1原创 2017-04-26 12:37:39 · 532 阅读 · 0 评论 -
poj2250 Compromise--最长公共子序列+打印序列+单词非字符
原题链接:http://poj.org/problem?id=2250#include<iostream>#include<string.h>#include<string>#include<algorithm>using namespace std;string s1[105];string s2[105];int dp[105][105];int len1, len2;void原创 2017-04-26 13:28:01 · 879 阅读 · 0 评论 -
hdu5119 Happy Matt Friends--dp
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=5119原创 2016-08-10 14:30:50 · 744 阅读 · 0 评论 -
hdu5532 Almost Sorted Array--最长上升子序列
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=5532一:分析求两次最长上升/下降子序列即可。二:AC代码#define _CRT_SECURE_NO_DEPRECATE #include#include#includeusing namespace std;int a[100005];原创 2016-08-02 17:46:14 · 1010 阅读 · 0 评论 -
hdu1160 FatMouse's Speed--DP&记录路径
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1160一:原题内容Problem DescriptionFatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the da原创 2016-03-26 21:02:17 · 793 阅读 · 0 评论 -
hdu1003 Max Sum--DP
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1003一:原题内容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 examp原创 2016-03-19 22:17:14 · 500 阅读 · 0 评论 -
hdu1176 免费馅饼--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1176一:原题内容Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以game原创 2016-03-20 23:24:04 · 578 阅读 · 0 评论 -
hdu1159 Common Subsequence--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1159一:原题链接Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given原创 2016-03-21 10:58:05 · 734 阅读 · 0 评论 -
hdu2577 How to Type---DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=2577一:原题内容Problem DescriptionPirates have finished developing the typing software. He called Cathy to test his typing software. She is g原创 2016-03-21 13:52:01 · 607 阅读 · 0 评论 -
hdu1505 City Game--DP/栈
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1505一:原题内容Problem DescriptionBob is a strategy game programming specialist. In his new city building game the gaming environment is as原创 2016-03-22 15:42:33 · 960 阅读 · 0 评论 -
hdu2870 Largest Submatrix--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=2870一:原题内容Problem DescriptionNow here is a matrix with letter 'a','b','c','w','x','y','z' and you can change 'w' to 'a' or 'b', change原创 2016-03-23 10:13:26 · 611 阅读 · 0 评论 -
hdu1421 搬寝室--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1421一:原题内容Problem Description搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是原创 2016-03-23 19:57:31 · 833 阅读 · 0 评论 -
hdu1058 Humble Numbers--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1058一:原题内容Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6,原创 2016-03-23 21:19:40 · 1173 阅读 · 0 评论 -
hdu2571 命运--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=2571一:原题内容Problem Description穿过幽谷意味着离大魔王lemon已经无限接近了!可谁能想到,yifenfei在斩杀了一些虾兵蟹将后,却再次面临命运大迷宫的考验,这是魔王lemon设下的又一个机关。要知道,不论何人,若在迷宫中被困1小时以上原创 2016-03-20 15:18:09 · 623 阅读 · 0 评论 -
hdu1024 Max Sum Plus Plus--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1024一:原题内容Problem DescriptionNow I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge原创 2016-03-26 14:55:55 · 656 阅读 · 0 评论 -
hdu1244 Max Sum Plus Plus Plus--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1244一:原题内容Problem Description给定一个由n个正整数组成的整数序列a1 a2 a3 ... an求按先后次序在其中取m段长度分别为l1、l2、l3...lm的不交叠的连续整数的和的最大值。 Input第一行是一个整原创 2016-03-26 18:27:48 · 654 阅读 · 0 评论 -
hdu1081 To The Max--DP(最大子矩阵和)
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1081一:原题内容Problem DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-arra原创 2016-03-27 09:55:09 · 696 阅读 · 0 评论 -
hdu2059 龟兔赛跑--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=2059一:原题内容Problem Description据说在很久很久以前,可怜的兔子经历了人生中最大的打击——赛跑输给乌龟后,心中郁闷,发誓要报仇雪恨,于是躲进了杭州下沙某农业园卧薪尝胆潜心修炼,终于练成了绝技,能够毫不休息得以恒定的速度(VR m/s)一直跑。兔子一原创 2016-03-27 14:06:23 · 724 阅读 · 0 评论 -
hdu1224 Free DIY Tour--DP
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1224一:原题内容Problem DescriptionWeiwei is a software engineer of ShiningSoft. He has just excellently fulfilled a software project with his原创 2016-03-27 15:44:55 · 666 阅读 · 0 评论 -
hdu1502 Regular Words--DP&大数问题
原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1502一:原题内容Problem DescriptionConsider words of length 3n over alphabet {A, B, C} . Denote the number of occurences of A in a word a as A原创 2016-03-28 22:41:27 · 726 阅读 · 0 评论 -
【简单dp】目录
hdu1501:二维dp原创 2017-03-29 13:02:04 · 799 阅读 · 0 评论