高数Umaru系列(9)——哈士奇 http://acm.sdut.edu.cn/onlinejudge2/index.php/Home/Index/problemdetail/pid/3358.html Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description 由于高数巨养的喵星人太傲娇了,要天天吃新鲜猫粮而且还经常欺负高数巨,所以高数巨决定买几条哈士奇尝尝鲜.这天高数巨来到了二手狗市场买哈士奇,高数巨看完了所有的哈士奇
一.题目 Description 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 side. And any radar installation, locating on the coasting, can only cover d distan
1. 如何理解 "贪心算法" 假设我们有一个可以容纳 100 Kg 物品的背包,可以装各种物品.我们有以下 5 种豆子,每种豆子的总量和总价值都各不相同.怎样装才能让背包里豆子的总价值最大呢? 这个问题其实很简单,我们只需要计算出每种豆子的单价,然后按照单价从高到低依次来装就好了.单价从高到低排列为:黑豆.绿豆.红豆.青豆和黄豆,因此我们往背包里装 20 Kg 黑豆.30 Kg 绿豆和 50 Kg 红豆. 实质上,这就是贪心算法的思想,用贪心算法解决问题的步骤一般是这样的. 第一步,当