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

摘要:描述 给两个有一定容量的箱子,往里面装宝石(宝石总容量不能超过箱子容量),不同的宝石有不同的容量和价值。求两个箱子里最大宝石的价值。 给两个有一定容量的箱子,往里面装宝石(宝石总容量不能超过箱子容量),不同的宝石有不同的容量和价值。求两个箱子里最大宝石的价值。 输入 line 1: Input n; 阅读全文
posted @ 2018-08-19 08:11 zdragon 阅读(320) 评论(0) 推荐(0)
摘要:描述 Seller: That will be fourteen dollars. Buyer: Here's a twenty. Seller: Sorry, I don't have any change. Buyer: OK, here's a ten and a five. Keep the 阅读全文
posted @ 2018-06-15 22:08 zdragon 阅读(276) 评论(0) 推荐(0)
摘要:It’s commonly known that the Dutch have invented copper-wire. Two Dutch men were fighting over a nickel, which was made of copper. They were both so e 阅读全文
posted @ 2018-06-15 21:54 zdragon 阅读(153) 评论(0) 推荐(0)
摘要:"Fat and docile, big and dumb, they look so stupid, they aren't much fun..." - Cows with Guns by Dana Lyons The cows want to prove to the public that 阅读全文
posted @ 2018-06-15 21:49 zdragon 阅读(163) 评论(0) 推荐(0)
摘要:The title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have seem this title.If you haven't 阅读全文
posted @ 2018-06-15 21:42 zdragon 阅读(233) 评论(0) 推荐(0)
摘要:电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。 某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的 阅读全文
posted @ 2018-06-15 21:35 zdragon 阅读(181) 评论(0) 推荐(0)
摘要:Bessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤ 阅读全文
posted @ 2018-06-15 21:31 zdragon 阅读(208) 评论(0) 推荐(0)
摘要:Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s 阅读全文
posted @ 2018-06-15 21:21 zdragon 阅读(192) 评论(0) 推荐(0)
摘要:The 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 they become t 阅读全文
posted @ 2018-06-15 21:15 zdragon 阅读(211) 评论(0) 推荐(0)
摘要:You have a long drive by car ahead. You have a tape recorder, but unfortunately your best music is on CDs. You need to have it on tapes so the problem 阅读全文
posted @ 2018-05-04 13:19 zdragon 阅读(235) 评论(0) 推荐(0)
摘要:描述Like everyone, cows enjoy variety. Their current fancy is new shapes for pastures. The old rectangular shapes are out of favor; new geometries are t 阅读全文
posted @ 2018-05-04 12:57 zdragon 阅读(327) 评论(0) 推荐(0)
摘要:题目描述 Taotao的电脑带不动绝地求生,所以taotao只能去玩pc版的荒野行动了,和绝地求生一样,游戏人物本身可以携带一定重量m的物品,装备背包之后可以多携带h(h为0代表没有装备背包)重量的东西。玩了几天taotao发现了一个BUG,当装备背包之后,如果可携带重量没有满,就可以拿一个任意重的 阅读全文
posted @ 2018-01-28 19:39 zdragon 阅读(251) 评论(0) 推荐(0)