Poj1328Radar Installation雷达安装


原题链接

经典贪心,转化为问题为,对于所有的区间,求最小的点数能使每个区间都至少有一个点。

#include
#include
#include
#include
#include
#include
using namespace std;

const int MAXN=100000+5;
const double eps=0.000001;
struct seg
{
	double l,r;
	bool operator < (const seg& b)const
	{
		if(l==b.l)
			return rt)
				{
					++ans;
					t=e[i].r;
				}
				if(e[i].r