随笔分类 -  ACM--贪心

摘要:Milking CowsThree farmers rise at 5 am each morning and head for the barn to milk three cows. The first farmer begins milking his cow at time 300 (measured in seconds after 5 am) and ends at time 1000. The second farmer begins at time 700 and ends at time 1200. The third farmer begins at time 1500 a 阅读全文
posted @ 2012-08-20 21:58 _雨 阅读(362) 评论(0) 推荐(0) 编辑
摘要:http://poj.org/problem?id=1328以每个点为圆心 d为半径 画圆 记录与x轴交出的区间 就变成区间覆盖的问题了 贪心若区间有重叠 区间重叠的地方放一个雷达就可以覆盖这几个区间的点了把该换成double 的数都换成double 这里WA了n次啊View Code 1 #include<stdio.h> 2 #include<iostream> 3 #include<algorithm> 4 #include<cmath> 5 using namespace std; 6 struct node 7 { 8 double d 阅读全文
posted @ 2012-08-18 17:45 _雨 阅读(210) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示