随笔分类 -  贪心算法

摘要: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 阅读(176) 评论(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 阅读(270) 评论(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 阅读(222) 评论(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 阅读(169) 评论(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 阅读(183) 评论(0) 推荐(0)
摘要:“今年暑假不AC?” “是的。” “那你干什么呢?” “看世界杯呀,笨蛋!” “@#$%^&*%...” 确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。 作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些其它的节目,比如新闻联播(永 阅读全文
posted @ 2020-02-13 21:17 MOSHANG_SUSIE 阅读(163) 评论(0) 推荐(0)
摘要:贪心算法(又称贪婪算法)是指,在对问题求解时,总是做出在当前看来是最好的选择。也就是说,不从整体最优上加以考虑,他所做出的是在某种意义上的局部最优解。 贪心算法不是对所有问题都能得到整体最优解,关键是贪心策略的选择,选择的贪心策略必须具备无后效性,即某个状态以前的过程不会影响以后的状态,只与当前状态 阅读全文
posted @ 2020-02-13 21:02 MOSHANG_SUSIE 阅读(362) 评论(0) 推荐(0)