。。。

导航

随笔分类 -  ACM--动态规划

上一页 1 2

poj 1014 Dividing 【多重背包】
摘要:DividingDescriptionMarsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share... 阅读全文

posted @ 2017-07-27 15:44 大学僧 阅读(149) 评论(0) 推荐(0)

hdu1231 最大连续子序列
摘要:最大连续子序列Problem Description给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 #include#define N 10000+10int now_start;int max_start,ma... 阅读全文

posted @ 2017-07-27 08:20 大学僧 阅读(131) 评论(0) 推荐(0)

【dp专题1】hdu1087最大上升子段和 E - Super Jumping! Jumping! Jumping!
摘要:Super Jumping! Jumping! Jumping!Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Ma... 阅读全文

posted @ 2017-07-26 15:42 大学僧 阅读(202) 评论(0) 推荐(0)

【dp专题1】F - Common Subsequence 【最长公共子序列模板LCS】hdu1159
摘要:A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z ... 阅读全文

posted @ 2017-07-25 18:34 大学僧 阅读(162) 评论(0) 推荐(0)

【dp专题1】B - I NEED A OFFER! 【01背包】 hdu1203
摘要:Speakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不... 阅读全文

posted @ 2017-07-25 14:58 大学僧 阅读(144) 评论(0) 推荐(0)

hdu 1171 Big Event in HDU 01背包
摘要:Big Event in HDUProblem DescriptionNowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Comput... 阅读全文

posted @ 2017-07-24 18:04 大学僧 阅读(127) 评论(0) 推荐(0)

HDU 2048 数塔 简单DP
摘要:数塔Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗? Input输入数据首先包括一个整数C,表示测试... 阅读全文

posted @ 2017-07-24 13:43 大学僧 阅读(167) 评论(0) 推荐(0)

51nod 1006 最长公共子序列Lcs【模板】
摘要:给出两个字符串A B,求A与B的最长公共子序列(子序列不要求是连续的)。 比如两个串为:abcicba abdkscabab是两个串的子序列,abc也是,abca也是,其中abca是这两个字符串最长的子序列。 Input 第1行:字符串A 第2行:字符串B(A,B的长度 #inclu... 阅读全文

posted @ 2017-06-29 18:59 大学僧 阅读(169) 评论(0) 推荐(0)

HDU2602 01背包入门 Bone Collector【01背包模板题】
摘要:Problem Description Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of b... 阅读全文

posted @ 2017-05-05 16:32 大学僧 阅读(170) 评论(0) 推荐(0)

HDU2546饭卡 01背包入门
摘要:** Problem Description 电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。 某天,... 阅读全文

posted @ 2017-05-05 07:31 大学僧 阅读(163) 评论(0) 推荐(0)

HAUTOJ 1266: 最大子段和 河工大校赛DP
摘要:**1266: 最大子段和题目描述一个大小为n的数组a1到an(−10^4≤ai≤10^4)。请你找出一个连续子段,使子段长度为奇数,且子段和最大。输入第一行为T(1≤T≤5),代表数据组数。 之后每组数据,第一行为n(1≤n≤10^5),代表数组长度。 之后一行n个数,代表a1到a... 阅读全文

posted @ 2017-05-03 19:13 大学僧 阅读(315) 评论(0) 推荐(0)

hdu杭电1003 dp 连续子序列最大值
摘要:Problem Description Given 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,... 阅读全文

posted @ 2017-04-26 07:27 大学僧 阅读(146) 评论(0) 推荐(0)

上一页 1 2