
贪心的使用
文章平均质量分 74
暮光乐鱼
这个作者很懒,什么都没留下…
展开
-
hdu 1009 FatMouse' Trade(贪心)
题目来源:hdu 1009 FatMouse’ Trade FatMouse’ Trade Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 54581 Accepted Submission(s): 18299 Pro原创 2015-08-27 17:54:38 · 664 阅读 · 0 评论 -
POJ 1328 Radar Installation【贪心】
本题主要是查找每个岛屿能被探测到的可放雷达区间,然后使贪心算法。AC代码: #include #include #include using namespace std; struct node { double left; double right; }a[1100]; bool cmp(node a,node b) { if(a.right != b.r原创 2015-07-31 21:16:25 · 371 阅读 · 0 评论 -
hdu 2037 今年暑假不AC
本题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2037 本题属于贪心题,先将结束时间排序,然后查找开始时间在前面时间段结束时间后面的时间段,查找到之后再继续查找开始时间在当前时间段结束时间后的。AC代码: #include #include #include using namespace std; struct node {原创 2015-07-31 15:22:41 · 383 阅读 · 0 评论 -
hdu 2187 悼念512汶川大地震遇难同胞——老人是真饿了
本题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2187 本题将单价升序排列,总重量计算较简单,AC代码: #include #include using namespace std; struct node { int price; int weight; }a[1100]; //数组开小提交错了多次!!! int原创 2015-07-31 16:50:05 · 488 阅读 · 0 评论