greed专题

贪心(Greed)算法:电台覆盖问题

1,应用场景—集合覆盖问题 假设存在下面需要付费的广播电台,以及广播电台可以覆盖的地区。如何选择最少的电台,能实现区域的全覆盖 2,贪心算法介绍 贪心算法(贪婪算法)是指在对问题进行求解时,在每一步的选择中都选择最优解,从而期望能够导致结果是最优解的算法贪心算法所得到的结果不一定是最优解,但是一定是相对近似最优解的结果 3,贪心算法最佳应用演示—集合覆盖问题 已知存在多少电台,及电台对

A - Greed CodeForces - 892A(水题)

Jafar has n cans of cola. Each can is described by two integers: remaining volume of cola ai and can’s capacity bi (ai  ≤  bi). Jafar has decided to pour all remaining cola into just 2 cans, determin