2013年11月29日
摘要: DescriptionThe galaxy war between the Empire Draco and the Commonwealth of Zibu broke out 3 years ago. Draco established a line of defense called Grot. Grot is a straight line withNdefense stations. Because of the cooperation of the stations, Zibu’s Marine Glory cannot march any further but stay out 阅读全文
posted @ 2013-11-29 21:48 straw_berry 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 题意:给一些物品item[],这些物品的重量在101至300之间,要将这些物品全部放进若干个bins中,已知bins盛的重量为300,可以将bins装满也可以不装满,问放这些物品最少需要几个bins.思路:当时把最关键的地方忽略了,就是物品的重量在101至300之间,这就说明每个bins至多放2个物品。然后从小到大排序,倒着贪心就可以了。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 9 class BinPackingEasy10 {11 private:. 阅读全文
posted @ 2013-11-29 14:23 straw_berry 阅读(239) 评论(0) 推荐(0) 编辑