随笔分类 -  动态规划-01背包

摘要:A. Balloons A. Balloons There are quite a lot of ways to have fun with inflatable balloons. For example, you can fill them with water and see what hap 阅读全文
posted @ 2018-07-02 13:07 starry_sky 阅读(557) 评论(0) 推荐(0)
摘要:电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。 某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的 阅读全文
posted @ 2017-07-17 09:49 starry_sky 阅读(274) 评论(0) 推荐(0)
摘要:Charm Bracelet Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 40141 Accepted: 17439 Description Bessie has gone to the mall's jewelry stor 阅读全文
posted @ 2017-07-17 09:47 starry_sky 阅读(396) 评论(0) 推荐(0)
摘要:在N件物品取出若干件放在容量为W的背包里,每件物品的体积为W1,W2……Wn(Wi为整数),与之相对应的价值为P1,P2……Pn(Pi为整数)。求背包能够容纳的最大价值。 Input 第1行,2个整数,N和W中间用空格隔开。N为物品的数量,W为背包的容量。(1 <= N <= 100,1 <= W 阅读全文
posted @ 2017-07-17 09:43 starry_sky 阅读(216) 评论(0) 推荐(0)