![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心
文章平均质量分 54
Hacb
这个作者很懒,什么都没留下…
展开
-
【HDU 4864】Task【贪心】
题意:有n个机器,m个任务。每个机器至多能完成一个任务。对于每个机器,有一个最大运行时间xi和等级yi,对于每个任务,也有一个运行时间xj和等级yj。只有当xi>=xj且yi>=yj的时候,机器i才能完成任务j,并获得500*xj+2*yj金钱。问最多能完成几个任务,当出现多种情况时,输出获得金钱最多的情况。 题解: 将任务已x从大到小排序(x相同时已y从大到小排序)。然后也用相同排序方法排序转载 2014-07-23 09:35:01 · 619 阅读 · 0 评论 -
【TOJ 1163】Gone Fishing【贪心+枚举】
题意:给出n个湖,还有渔夫这次行钓的总时间,原创 2014-07-28 21:34:58 · 529 阅读 · 0 评论 -
【TOJ 1180】Inversion【贪心】
题意:给n m,求一个字典序最小的序列使得逆序对等于m 思路:yinwei原创 2014-07-29 20:40:35 · 432 阅读 · 0 评论 -
【TOJ 3585】Covering the Corral【贪心】
#include #include #include using namespace std; #define N 100004 struct Li{ int s, e; bool operator<(Li a) const { if (a.s == s) return e < a.e; return s < a.s; } }l[N]原创 2014-09-06 20:35:36 · 593 阅读 · 0 评论