随笔分类 -  ACM-背包

摘要:Beef McNuggetsHubert ChenFarmer Brown's cows are up in arms, having heard that McDonalds is considering the introduction of a new product: Beef McNuggets. The cows are trying to find any possible way to put such a product in a negative light.One strategy the cows are pursuing is that of `inferio 阅读全文
posted @ 2012-09-26 14:17 mtry 阅读(928) 评论(0) 推荐(0)
摘要:StampsGiven a set of N stamp values (e.g., {1 cent, 3 cents}) and an upper limit K to the number of stamps that can fit on an envelope, calculate the largest unbroken list of postages from 1 cent to M cents that can be created.For example, consider stamps whose values are limited to 1 cent and 3 cen 阅读全文
posted @ 2012-09-12 09:31 mtry 阅读(403) 评论(0) 推荐(0)
摘要:Score InflationThe more points students score in our contests, the happier we here at the USACO are. We try to design our contests so that people can score as many points as possible, and would like your assistance.We have several categories from which problems can be chosen, where a "category& 阅读全文
posted @ 2012-09-11 10:50 mtry 阅读(347) 评论(0) 推荐(0)
摘要:Money SystemsThe cows have not only created their own government but they have chosen to create their own money system. In their own rebellious way, they are curious about values of coinage. Traditionally, coins come in values like 1, 5, 10, 20 or 25, 50, and 100 units, sometimes with a 2 unit coin 阅读全文
posted @ 2012-09-04 15:57 mtry 阅读(470) 评论(0) 推荐(0)
摘要:Subset SumsJRMFor many sets of consecutive integers from 1 through N (1 <= N <= 39), one can partition the set into two sets whose sums are identical.For example, if N=3, one can partition the set {1, 2, 3} in one way so that the sums of both subsets are identical:{3} and {1,2}This counts as a 阅读全文
posted @ 2012-09-01 11:29 mtry 阅读(1157) 评论(0) 推荐(0)
摘要:Ahui Writes WordTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1075Accepted Submission(s): 406Problem DescriptionWe all know that English is very important, so Ahui strive for this in order to learn more English words. To know that word has its va 阅读全文
posted @ 2012-08-23 21:41 mtry 阅读(732) 评论(0) 推荐(0)
摘要:Watch The MovieTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 3057Accepted Submission(s): 996Problem DescriptionNew semester is coming, and DuoDuo has to go to school tomorrow. She decides to have fun tonight and will be very busy after tonight. S 阅读全文
posted @ 2012-08-22 23:14 mtry 阅读(698) 评论(0) 推荐(0)
摘要:I love sneakers!Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2229Accepted Submission(s): 910Problem DescriptionAfter months of hard working, Iserlohn finally wins awesome amount of scholarship. As a great zealot of sneakers, he decides to spend 阅读全文
posted @ 2012-08-21 23:07 mtry 阅读(1334) 评论(0) 推荐(0)
摘要:RobberiesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4852Accepted Submission(s): 1844Problem DescriptionThe aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because the 阅读全文
posted @ 2012-08-17 09:09 mtry 阅读(4134) 评论(0) 推荐(5)
摘要:In ActionTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2099Accepted Submission(s): 695Problem DescriptionSince 1945, when the first nuclear bomb was exploded by the Manhattan Project team in the US, the number of nuclear weapons have soared acros 阅读全文
posted @ 2012-08-16 09:56 mtry 阅读(525) 评论(0) 推荐(0)
摘要:Bone Collector IITime Limit: 5000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 832Accepted Submission(s): 395Problem DescriptionThe title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have s 阅读全文
posted @ 2012-08-13 22:05 mtry 阅读(828) 评论(0) 推荐(1)
摘要:CoinsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3287Accepted Submission(s): 1293Problem DescriptionWhuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He dec 阅读全文
posted @ 2012-08-13 09:20 mtry 阅读(1677) 评论(0) 推荐(0)
摘要:FATETime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3806Accepted Submission(s): 1667Problem Description最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐 阅读全文
posted @ 2012-08-12 23:29 mtry 阅读(250) 评论(0) 推荐(0)
摘要:最大报销额Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10647Accepted Submission(s): 2875Problem Description现有一笔经费可以报销一定额度的发票。允许报销的发票类型包括买图书(A类)、文具(B类)、差旅(C类),要求每张发票的总额不得超过1000元,每张发票上,单项物品的价值不得超过600元。现请你编写程序,在给出的一堆发票中找出可以报销的、不超过给定额度的最大报销额。Input测试输入包含若 阅读全文
posted @ 2012-08-12 22:14 mtry 阅读(194) 评论(0) 推荐(0)
摘要:ACboy needs your helpTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1768Accepted Submission(s): 890Problem DescriptionACboy has N courses this term, and he plans to spend at most M days on study.Of course,the profit he will gain from different cou 阅读全文
posted @ 2012-08-12 20:03 mtry 阅读(756) 评论(0) 推荐(0)
摘要:I NEED A OFFER!Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9710Accepted Submission(s): 3584Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的 阅读全文
posted @ 2012-08-12 19:18 mtry 阅读(221) 评论(0) 推荐(0)
摘要:DividingTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8755Accepted Submission(s): 2374Problem 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 ma 阅读全文
posted @ 2012-08-01 20:45 mtry 阅读(2366) 评论(0) 推荐(0)
摘要:开心的小明时间限制:1000 ms | 内存限制:65535 KB难度:4描述小明今天很开心,家里购置的新房就要领钥匙了,新房里有一间他自己专用的很宽敞的房间。更让他高兴的是,妈妈昨天对他说:“你的房间需要购买哪些物品,怎么布置,你说了算,只要不超过N 元钱就行”。今天一早小明就开始做预算,但是他想买的东西太多了,肯定会超过妈妈限定的N 元。于是,他把每件物品规定了一个重要度,分为5 等:用整数1~5 表示,第5 等最重要。他还从因特网上查到了每件物品的价格(都是整数元)。他希望在不超过N 元(可以等于N 元)的前提下,使每件物品的价格与重要度的乘积的总和最大。设第j 件物品的价格为v[j], 阅读全文
posted @ 2012-04-17 21:42 mtry 阅读(715) 评论(0) 推荐(0)