摘要: 题目简述:监狱里要放囚徒,但是没那么简单,必须要有封口费给别的囚徒,否则她们就会大闹天宫,当遇到空牢房(因为有囚徒放出来了)或者碰壁了才会停止发放金币,问:怎样使给出的金币最少? 思路:可以用dp的做法 以下是代码(其实有个疑问,似乎不用函数做这题是做不出的?!) #include <set> #i 阅读全文
posted @ 2020-07-14 09:54 MOSHANG_SUSIE 阅读(306) 评论(0) 推荐(0)
摘要: 对于吃货来说,过年最幸福的事就是吃了,没有之一! 但是对于女生来说,卡路里(热量)是天敌啊! 资深美女湫湫深谙“胖来如山倒,胖去如抽丝”的道理,所以她希望你能帮忙制定一个食谱,能使她吃得开心的同时,不会制造太多的天敌。 当然,为了方便你制作食谱,湫湫给了你每日食物清单,上面描述了当天她想吃的每种食物 阅读全文
posted @ 2020-02-17 19:48 MOSHANG_SUSIE 阅读(112) 评论(0) 推荐(0)
摘要: 电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。 某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的 阅读全文
posted @ 2020-02-16 22:43 MOSHANG_SUSIE 阅读(165) 评论(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 @ 2020-02-16 22:28 MOSHANG_SUSIE 阅读(158) 评论(0) 推荐(0)
摘要: 虽然大佬已经为我们罗列了背包九讲:https://blog.csdn.net/m0_37809890/article/details/83153974 但是我觉得自己还是要再罗列 01背包 有n件物品,每件物品的重量为w[i],价值为c[i]。现有一个容量为V的背包,问如何选取物品放入背包,使得背包 阅读全文
posted @ 2020-02-16 22:23 MOSHANG_SUSIE 阅读(551) 评论(0) 推荐(0)
摘要: Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea 阅读全文
posted @ 2020-02-16 21:24 MOSHANG_SUSIE 阅读(175) 评论(0) 推荐(0)
摘要: A group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arrangement mu 阅读全文
posted @ 2020-02-16 20:35 MOSHANG_SUSIE 阅读(267) 评论(0) 推荐(0)
摘要: A factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*3, 4*4, 5*5, 6*6. These products are always del 阅读全文
posted @ 2020-02-16 20:29 MOSHANG_SUSIE 阅读(220) 评论(0) 推荐(0)
摘要: The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure. The floor has 200 rooms each 阅读全文
posted @ 2020-02-13 21:34 MOSHANG_SUSIE 阅读(167) 评论(0) 推荐(0)
摘要: FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. The warehouse has 阅读全文
posted @ 2020-02-13 21:25 MOSHANG_SUSIE 阅读(179) 评论(0) 推荐(0)