
贪心
方品
fangpin.github.io
展开
-
EOJ1488
Description 1-cent coin. Additionally, there’s a bill whose value of K cents is known toexceed any of the coins. There’s a coin collector who wants to collect a specimenof each denomination of co原创 2014-12-06 22:47:23 · 712 阅读 · 0 评论 -
EOJ1855 贪心+优先队列
题目: Expedition Time Limit:1000MS Memory Limit:30000KB Total Submit:529 Accepted:157 Description A group of cows grabbed a truck and ventured on an expedition deep into t原创 2014-12-06 22:54:36 · 688 阅读 · 0 评论 -
poj1328 贪心
大意是x轴上方有n个目标点,坐标全为整数,为了扫描到他们,在x轴上安放雷达,每一个雷达扫描半径为d,问至少安放多少雷达。 首先想到的是化归。找出每一点在x轴上的扫描边界,即在这个范围内必须有雷达才能扫描到。这样便将问题化归为:给n个闭区间,找出最少的点,保证每个区间至少有一个点。 贪心算法:我们先将问题的区间集合按右端点排序,从最左边的区间开始,如果该区间内雷达为空为空,原创 2015-05-21 20:47:32 · 862 阅读 · 0 评论