
DP
life4711
这个作者很懒,什么都没留下…
展开
-
POJ 1088 DFS+DP
http://poj.org/problem?id=1088DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 5原创 2014-02-25 14:51:58 · 657 阅读 · 0 评论 -
POJ 1321
http://poj.org/problem?id=1321Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开原创 2014-02-25 21:18:26 · 755 阅读 · 1 评论 -
HDU 1248 背包问题之完全背包
http://acm.hdu.edu.cn/showproblem.php?pid=1248Problem Description不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(记住,只有一张钞票),为了防止自己在战斗中频繁的死掉,他决定给自己买一些道具,于是他来到了地精商店前.死亡骑士:"我要买道具!"地精商人:"我们这里有三种道具,血瓶150块一个,魔法原创 2014-02-15 17:52:50 · 1351 阅读 · 0 评论 -
hdu 1159 最长公共子序列问题
http://acm.hdu.edu.cn/showproblem.php?pid=1159Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = an原创 2014-02-27 16:25:31 · 888 阅读 · 0 评论 -
hdu 2602 背包问题之01背包
http://acm.hdu.edu.cn/showproblem.php?pid=2602Problem DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bone原创 2014-02-15 12:37:50 · 697 阅读 · 0 评论 -
POJ 3624 还是01背包
http://poj.org/problem?id=3624DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤原创 2014-02-15 18:11:13 · 670 阅读 · 0 评论 -
HDU 1466 计算直线的交点数
http://acm.hdu.edu.cn/showproblem.php?pid=1466Problem Description平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。 Input输入数据包含多个测试实例,每个测试实例占一行,每行包含一个正整数n(n原创 2014-02-16 16:33:49 · 777 阅读 · 0 评论 -
HDU 2059 龟兔赛跑 (动态规划分析)
http://acm.hdu.edu.cn/showproblem.php?pid=2059Problem Description据说在很久很久以前,可怜的兔子经历了人生中最大的打击——赛跑输给乌龟后,心中郁闷,发誓要报仇雪恨,于是躲进了杭州下沙某农业园卧薪尝胆潜心修炼,终于练成了绝技,能够毫不休息得以恒定的速度(VR m/s)一直跑。兔子一直想找机会好好得教训一下乌龟,以雪前原创 2014-02-28 18:37:42 · 1392 阅读 · 0 评论 -
HDU 1176
http://acm.hdu.edu.cn/showproblem.php?pid=1176Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接原创 2014-02-28 13:00:35 · 2326 阅读 · 0 评论 -
HDU 2151 Worm
http://acm.hdu.edu.cn/showproblem.php?pid=2151Problem Description自从见识了平安夜苹果的涨价后,Lele就在他家门口水平种了一排苹果树,共有N棵。突然Lele发现在左起第P棵树上(从1开始计数)有一条毛毛虫。为了看到毛毛虫变蝴蝶的过程,Lele在苹果树旁观察了很久。虽然没有看到蝴蝶,但Lele发现了原创 2014-02-28 19:24:52 · 836 阅读 · 0 评论 -
POJ 1036 Gangsters
http://poj.org/problem?id=1036DescriptionN gangsters are going to a restaurant. The i-th gangster comes at the time Ti and has the prosperity Pi. The door of the restaurant has K+1 states of o原创 2014-03-02 10:22:53 · 779 阅读 · 0 评论 -
HDU 1203 01背包问题
http://acm.hdu.edu.cn/showproblem.php?pid=1203Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若原创 2014-03-02 15:06:01 · 914 阅读 · 0 评论 -
HDU 1114 又见完全背包问题(必须装满)
#include #include #include using namespace std;int dp[10005], w[10005],v[10005];int main(){ int n,m,y; cin >> y; while(y--) { memset(dp,0,sizeof(dp)); scanf("%d%d原创 2014-03-01 20:48:43 · 1784 阅读 · 0 评论 -
hdu 1081 最大子矩阵求和问题
http://acm.hdu.edu.cn/showproblem.php?pid=1081Problem DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1 x 1 or原创 2014-03-05 15:51:58 · 938 阅读 · 0 评论 -
HDU 1503 最长公共子序列的变形(重点在输出)
http://acm.hdu.edu.cn/showproblem.php?pid=1503Problem DescriptionThe company "21st Century Fruits" has specialized in creating new sorts of fruits by transferring genes from one fruit into t原创 2014-03-07 21:27:20 · 858 阅读 · 0 评论 -
UVA 231 最长下降子序列
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=167 Testing the CATCHER A military contractor for the Department of Defense h原创 2014-03-07 13:13:40 · 725 阅读 · 0 评论 -
POJ 1952 最长递增(减)子数列问题(稍难)
http://poj.org/problem?id=1952DescriptionThe advice to "buy low" is half the formula to success in the bovine stock market.To be considered a great investor you must also follow this problems'原创 2014-03-07 19:42:36 · 787 阅读 · 0 评论 -
codeforce 416/B 动态规划简单题
http://codeforces.com/problemset/problem/416/B原创 2014-04-14 13:08:08 · 1006 阅读 · 0 评论 -
哈理工第四届校赛,,,F题,背包
http://acm.hrbust.edu.cn/contests/index.php?act=showproblem&cid=250&p=FF.背包Time Limit: 5000 MSMemory Limit: 32768 KTotal Submit: 117 (38 users)Total Accep原创 2014-03-30 20:52:03 · 818 阅读 · 0 评论 -
HDU 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 example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5原创 2014-02-16 11:29:09 · 977 阅读 · 0 评论 -
HDU 1244 最大m段连续子串问题
http://acm.hdu.edu.cn/showproblem.php?pid=1244Problem Description给定一个由n个正整数组成的整数序列a1 a2 a3 ... an求按先后次序在其中取m段长度分别为l1、l2、l3...lm的不交叠的连续整数的和的最大值。 Input第一行是一个整数n(0 ≤ n ≤原创 2014-03-08 16:30:24 · 1416 阅读 · 0 评论 -
NEFU 655 图dp
TripTime Limit 1000msMemory Limit 65536Kdescription Xiao wang has a new car, so he wants to have a trip from his home to hefei, however, ther转载 2014-05-03 20:59:31 · 576 阅读 · 0 评论 -
codeforce 189A 完全背包之必须装满问题
http://codeforces.com/problemset/problem/189/AA. Cut Ribbontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output原创 2014-04-01 21:22:09 · 1202 阅读 · 0 评论 -
HDU 1087 Super Jumping! Jumping! Jumping!
http://acm.hdu.edu.cn/showproblem.php?pid=1087Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, an原创 2014-02-14 23:22:01 · 610 阅读 · 0 评论 -
hdu 2571 数塔变形
http://acm.hdu.edu.cn/showproblem.php?pid=2571Problem Description穿过幽谷意味着离大魔王lemon已经无限接近了!可谁能想到,yifenfei在斩杀了一些虾兵蟹将后,却再次面临命运大迷宫的考验,这是魔王lemon设下的又一个机关。要知道,不论何人,若在迷宫中被困1小时以上,则必死无疑!可怜的yifenfei原创 2014-05-15 21:26:12 · 543 阅读 · 0 评论 -
hdu 1069 dp
http://acm.hdu.edu.cn/showproblem.php?pid=1069Problem 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 build原创 2014-05-15 19:06:02 · 586 阅读 · 0 评论 -
DP
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1884原创 2014-05-12 16:51:43 · 680 阅读 · 0 评论 -
codeforce 447C
http://codeforces.com/contest/447/problem/C原创 2014-07-15 19:25:52 · 830 阅读 · 0 评论 -
code force 10D dp 最长公共上升子序列
http://vjudge.net/contest/view.action?cid=47807#problem/DDescriptionThis problem differs from one which was on the online contest.The sequence a1, a2, ..., an is called increasing, if ai原创 2014-06-10 15:54:58 · 924 阅读 · 0 评论 -
zoj 2672 DP+hash
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1672A sequence of integer numbers a1 , a2 , ..., an is called a Fibonacci sequence if ai = ai-2+ai-1 for all i=3,4,...,n.Given a sequ原创 2014-07-25 20:53:51 · 1214 阅读 · 0 评论 -
UVALIve 4256 图的dp
https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2257原创 2014-08-18 12:12:04 · 1022 阅读 · 0 评论 -
LCS 最长公共子序列并输出该序列
#include #include #include #include #include #include #include using namespace std;string s1,s2;string lcs2(string s1,string s2){ if(s1==""||s2=="") return ""; int m=s1.size(原创 2014-08-13 17:17:23 · 1397 阅读 · 0 评论 -
UVA10635 LCS 问题的 n*logn 解法
http://vjudge.net/contest/view.action?cid=53516#problem/BDescription Problem EPrince and PrincessInput: Standard InputOutput: Standard OutputTime Limit: 3 Seconds In an n原创 2014-08-14 18:10:34 · 779 阅读 · 0 评论 -
2013长沙站J题||hdu 4800 dp
http://acm.hdu.edu.cn/showproblem.php?pid=4800原创 2014-08-27 15:40:18 · 865 阅读 · 0 评论 -
uva 10891 dp类似博弈
http://vjudge.net/contest/view.action?cid=53516#problem/CDescriptionProblem EGame of SumInput File: e.inOutput: Standard Output This is a two player game. Initially there are n int原创 2014-08-15 11:27:20 · 637 阅读 · 0 评论 -
hdu1025最长上升子序列 (加二分优化)
http://acm.hdu.edu.cn/showproblem.php?pid=1025Problem DescriptionJGShining's kingdom consists of 2n(n is no more than 500,000) small cities which are located in two parallel lines.Half o原创 2014-03-04 20:08:02 · 1319 阅读 · 0 评论 -
UVA 11825 dp、状态压缩、二进制法表示集合
http://vjudge.net/vjudge/contest/view.action?cid=53516#problem/D原创 2014-08-16 09:56:41 · 732 阅读 · 0 评论 -
UVA 10859 有向无环图的动态规划
http://vjudge.net/vjudge/contest/view.action?cid=53516#problem/EDescriptionInput: Standard InOutput: Standard OutNext Generation Contest 1 Time Limit: 2 seconds原创 2014-08-16 11:58:36 · 928 阅读 · 0 评论 -
陈老师的多校联合20140816A题||spoj 10228 动态规划
http://www.spoj.com/problems/AMR11A/原创 2014-08-17 11:13:12 · 990 阅读 · 0 评论 -
uva 11584 字符串 dp
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2631原创 2014-08-18 10:17:47 · 754 阅读 · 0 评论