
DP
文章平均质量分 79
Zeny_L
:-
展开
-
HDU 4508 (13.07.31)
Problem Description 对于吃货来说,过年最幸福的事就是吃了,没有之一! 但是对于女生来说,卡路里(热量)是天敌啊! 资深美女湫湫深谙“胖来如山倒,胖去如抽丝”的道理,所以她希望你能帮忙制定一个食谱,能使她吃得开心的同时,不会制造太多的天敌。 当然,为了方便你制作食谱,湫湫给了你每日食物清单,上面描述了当天她想吃的每种食物能带给她的幸福程度,以及会增加的原创 2013-07-31 20:21:29 · 975 阅读 · 0 评论 -
UVA 111 (复习dp, 14.07.09)
History Grading Background Many problems in Computer Science involve maximizing some measure according to constraints. Consider a history exam in which students are asked to put seve原创 2014-07-09 16:49:28 · 982 阅读 · 0 评论 -
UVA 357 (硬币拼数额 DP 14.3.10)
Let Me Count The Ways After making a purchase at a large department store, Mel's change was 17 cents. He received 1 dime, 1 nickel, and 2 pennies. Later that day, he was shopping at a conv原创 2014-03-10 23:12:31 · 1028 阅读 · 0 评论 -
UVA 562 (用硬币拼数额 DP 14.3.11)
Dividing coins It's commonly known that the Dutch have invented copper-wire. Two Dutch men were fighting over a nickel, which was made of copper. They were both so eager to get it and the原创 2014-03-11 16:56:40 · 1079 阅读 · 0 评论 -
HDU 2191 (01背包问题 13.12.02)
悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 11692 Accepted Submission(s): 4961 Problem Description 急!灾原创 2013-12-02 21:07:50 · 795 阅读 · 0 评论 -
POJ 2677 (双调欧几里德旅行商问题 14.5.29)
双调欧几里得旅行商问题是一个经典动态规划问题。《算法导论(第二版)》思考题15-1和北京大学OJ2677都出现了这个题目。 旅行商问题描述:平面上n个点,确定一条连接各点的最短闭合旅程。这个解的一般形式为NP的(在多项式时间内可以求出) J.L. Bentley 建议通过只考虑双调旅程(bitonictour)来简化问题,这种旅程即为从最左点开始,严格地从左到右直至最右点,原创 2014-05-29 23:18:48 · 1010 阅读 · 0 评论 -
HDU 1231 (13.12.02)
Problem Description 给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 例如给定序列{ -2, 11, -4, 13, -5, -2 },其最大连续子序列为{ 11, -4, 13 },最大和 为20。 在今年的数据结构考卷中,要求编写程序得到最大和,现在增加一个要求,即还需要输原创 2013-12-02 19:57:41 · 804 阅读 · 0 评论 -
HDU 4455 (13.10.31)
Substrings Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 183 Accepted Submission(s): 42 Problem Description XXX has an array of原创 2013-10-31 22:28:58 · 728 阅读 · 0 评论 -
UVA 10405 (13.07.26)
Problem C: Longest Common Subsequence Sequence 1: Sequence 2: Given two sequences of characters, print thelength of the longest common subsequence of both sequences. Forexample, the longest原创 2013-07-26 12:03:14 · 720 阅读 · 0 评论 -
HDU 3732 (13.07.25)
Ahui Writes Word Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1607 Accepted Submission(s): 608 Problem Description We all know th原创 2013-07-25 21:38:58 · 718 阅读 · 0 评论 -
UVA 674 (入门DP, 14.07.09)
Coin Change Suppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amount of money. For example, if原创 2014-07-09 21:01:35 · 789 阅读 · 0 评论