随笔分类 -  背包

AreYouBusy
摘要:Problem DescriptionHappy New Term! As having become a junior, xiaoA recognizes that there is not much time for her to AC problems, because there are some other things for her to do, which makes her nearly mad. What's more, her boss tells her that for some sets of duties, she must choose at least 阅读全文

posted @ 2013-10-07 18:56 forevermemory 阅读(439) 评论(0) 推荐(0)

i love sneakers
摘要:#include #include #include using namespace std; int p[105][105]; int pp[105][105]; int des[105]; int sum[12][10005]; int n,v,g; int maxi(int a,int b) { return ab?a:b; } int main() { int i,j,k,l,a,b,c; while(scanf("%d %d %d",&n,&v,&g)!=EOF) { memset(p,0,sizeof(p)); memset(pp,0,sizeof(pp)); memset(des,0,sizeof(des)); memset(sum,-1,sizeof(sum)); for(i=0;i=v;i++) sum[0][i]=0; for(i=0;in;i++) { scanf("%d %d %d" 阅读全文

posted @ 2013-10-07 11:39 forevermemory 阅读(222) 评论(0) 推荐(0)

The contest
摘要:Description 殷犇有很多队员。他们都认为自己是最强的,于是,一场比赛开始了~ 于是安叔主办了一场比赛,比赛有n个题目,每个题目都有一个价值Pi和相对能力消耗Wi,但是有些题目因为太坑不能同时做出来,并且坑题具有传递性。(a和b一起做会坑、b和c会坑则a和c也会坑) ACM队员们想知道,于是他们想知道在能力范围内,它们最多可以作出多少价值的题目。 聪明的你,告诉我,能帮帮他们吗?Input 第1行两个整数,n,Wmax,k(0#include#include#include#includeusingnamespacestd;intfather[1005];intpri[1005];in 阅读全文

posted @ 2013-10-07 00:32 forevermemory 阅读(200) 评论(0) 推荐(0)

I NEED A OFFER!
摘要:Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Speakless估计了他得到这个学校offer的可能性b。不同学校之间是否得到offer不会互相影响。“I NEED A OFFER”,他大叫一声。帮帮这个可怜的人吧,帮助他计算一下,他可以收到至少一份offer的最大概率。(如果 阅读全文

posted @ 2013-07-20 23:30 forevermemory 阅读(156) 评论(0) 推荐(0)

Dividing
摘要:Problem DescriptionMarsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had the same value, because then they could just split the collection in half. But unfortunatel 阅读全文

posted @ 2013-06-25 23:39 forevermemory 阅读(294) 评论(0) 推荐(0)

Piggy-Bank
摘要:Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea behind is simple. Whenever some ACM member has any small money, he takes all the coins and throws 阅读全文

posted @ 2013-05-13 23:01 forevermemory 阅读(127) 评论(0) 推荐(0)

Bone Collector
摘要:Problem DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave … The bone collector had a big bag with a volume of V ,and along his trip of collecting there are a lo 阅读全文

posted @ 2013-05-13 11:56 forevermemory 阅读(158) 评论(0) 推荐(0)

Big Event in HDU
摘要:Problem DescriptionNowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer College had ever been split into Computer College and Software College in 2002. The splitting is absolutely a big event in HDU! At the same time, it is a troub 阅读全文

posted @ 2013-03-25 18:25 forevermemory 阅读(94) 评论(0) 推荐(0)