摘要:DividingDescriptionMarsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share...
阅读全文
摘要:最大连续子序列Problem Description给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 #include#define N 10000+10int now_start;int max_start,ma...
阅读全文
摘要:Super Jumping! Jumping! Jumping!Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Ma...
阅读全文
摘要:A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z ...
阅读全文
摘要:Speakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不...
阅读全文
摘要: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...
阅读全文
摘要:数塔Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗? Input输入数据首先包括一个整数C,表示测试...
阅读全文
摘要:给出两个字符串A B,求A与B的最长公共子序列(子序列不要求是连续的)。 比如两个串为:abcicba abdkscabab是两个串的子序列,abc也是,abca也是,其中abca是这两个字符串最长的子序列。 Input 第1行:字符串A 第2行:字符串B(A,B的长度 #inclu...
阅读全文
摘要: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...
阅读全文
摘要:** Problem Description 电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。 某天,...
阅读全文
摘要:**1266: 最大子段和题目描述一个大小为n的数组a1到an(−10^4≤ai≤10^4)。请你找出一个连续子段,使子段长度为奇数,且子段和最大。输入第一行为T(1≤T≤5),代表数据组数。 之后每组数据,第一行为n(1≤n≤10^5),代表数组长度。 之后一行n个数,代表a1到a...
阅读全文
摘要: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,...
阅读全文