摘要: Description 上次去超市扫荡回来的东西用完了,Staginner又得跑超市一趟,出发前他列了一张购物清单,打算去买K种不同的商品,每种买一件。到了超市,Staginner发现每种商品有N个品牌,每个品牌此商品的价格为Vi,对Staginner的作用值为Wi,他会从这N个品牌里面挑一个品牌买。这时,Staginner突然想起出门时只带了M元钱,又懒得去取钱了,所以不一定能买完K种商品,只好尽可能地让买的东西对自己的总作用值ans最大。Input多组样例。 第一行两个整数K,M代表Staginner想买的不同种类商品的数目和他带的钱 (0 < K <= 30, 0 < 阅读全文
posted @ 2012-07-23 23:41 BeatLJ 阅读(328) 评论(0) 推荐(0) 编辑
摘要: Calf FlacIt is said that if you give an infinite number of cows an infinite number of heavy-duty laptops (with very large keys), that they will ultimately produce all the world's great palindromes. Your job will be to detect these bovine beauties.Ignore punctuation, whitespace, numbers, and case 阅读全文
posted @ 2012-07-23 21:55 BeatLJ 阅读(228) 评论(0) 推荐(0) 编辑
摘要: DescriptionFarmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course.Farmer John ordered a high speed connection for his farm and is going to share his connectivity with the other farmers. T 阅读全文
posted @ 2012-07-23 17:18 BeatLJ 阅读(340) 评论(0) 推荐(0) 编辑