HDOJ_ACM_悼念512汶川大地震遇难同胞——珍惜现在,感恩生活
2012-12-01 23:18
309 查看
[align=left]Problem Description[/align] 急!灾区的食物依然短缺! 为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。 请问:你用有限的资金最多能采购多少公斤粮食呢? 后记: 人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。 月有阴晴圆缺,人有旦夕祸福,未来对于我们而言是一个未知数。那么,我们要做的就应该是珍惜现在,感恩生活—— 感谢父母,他们给予我们生命,抚养我们成人; 感谢老师,他们授给我们知识,教我们做人 感谢朋友,他们让我们感受到世界的温暖; 感谢对手,他们令我们不断进取、努力。 同样,我们也要感谢痛苦与艰辛带给我们的财富~ View Code |
[align=left]Key Points[/align] [align=left]The first one is just using 0/1 knapsack, you can get the answer.[/align] [align=left]For the second one , I classified the situations and dissicuss. the things which you will be confuse maybe the efficial 0/1 knapsack. [/align] [align=left] [/align] [align=left]Efficial 0/1 knapsack for the same things:[/align] [align=left]for example, 7, it can be made up by 001 010 and 111. [/align] [align=left]To begin with, make the 001 010 things into the bag, then rest packet is 3.[/align] [align=left]Secondly, take the 3 things into the bag one by one.[/align] [align=left]If you still fell confuse, you can draw it out. Maybe you will understand.[/align] [align=left] [/align] |
[align=left] [/align] |
相关文章推荐
- HDOJ 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 杭电 ACM
- hdoj 2191 (多维背包问题)悼念512汶川大地震遇难同胞——珍惜现在,感恩生活
- 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活(hdoj--2191--多重背包)
- HDOJ-2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活
- hdoj 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活(背包问题)
- [HDOJ] 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 [多重背包+二进制优化]
- HDOJ 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活(多重背包)
- YT06-背包-1003—悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 -(6.27日-烟台大学ACM预备队解题报告)
- hdoj 2191悼念512汶川大地震遇难同胞——珍惜现在,感恩生活【dp】
- HDOJ 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活(完全背包)
- HDOJ 题目2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活(多重背包问题)
- hdoj 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活【背包问题】
- 杭电ACM 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活(多重背包问题)
- HDOJ 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 2191
- HDOJ 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活(多重背包转化01背包)
- HDOJ(HDU).2191. 悼念512汶川大地震遇难同胞――珍惜现在,感恩生活 (DP 多重背包+二进制优化)
- hdoj-2191-悼念512汶川大地震遇难同胞——珍惜现在,感恩生活
- hdoj 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 【多重背包 01背包】
- HDOJ 2192 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活
- HDOJ 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 (多重背包)