/* poj 1474 Video Surveillance - 求多边形有没有核 */ #include <stdio.h> #include<math.h> const double eps=1e-8; const int N=103; struct point { double x,y; }dian[N]; inline bool mo_ee(double x,double y) { double ret=x-y; if(ret<0) ret=-ret; if(ret&…
链接:http://poj.org/problem?id=1474 Video Surveillance Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 3247   Accepted: 1440 Description A friend of yours has taken the job of security officer at the Star-Buy Company, a famous depart- ment…
半平面交求多边形的核,注意边是顺时针给出的 //卡精致死于是换(?)了一种求半平面交的方法-- #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> using namespace std; const int N=505; int n,cas; const double eps=1e-8; struct dian { double x,y; dian(double X…
题链: http://poj.org/problem?id=1474 题解: 计算几何,半平面交 半平面交裸题,快要恶心死我啦... (了无数次之后,一怒之下把onleft改为onright,然后还加了一个去重,总算是过了...) 代码: #include<cmath> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #define MAXN 15…
http://poj.org/problem?id=1474 解法同POJ 1279 A一送一 缺点是还是O(n^2) ...nlogn的过几天补上... /********************* Template ************************/ #include <set> #include <map> #include <list> #include <cmath> #include <ctime> #include…
题目链接 2Y,模版抄错了一点. #include <cstdio> #include <cstring> #include <string> #include <cmath> #include <algorithm> using namespace std; #define eps 1e-8 #define N 2001 struct point { double x,y; }p[N],pre[N],temp[N]; double a,b,c;…
/* poj 3130 How I Mathematician Wonder What You Are! - 求多边形有没有核 */ #include <stdio.h> #include<math.h> const double eps=1e-8; const int N=103; struct point { double x,y; }dian[N]; inline bool mo_ee(double x,double y) { double ret=x-y; if(ret&l…
<题目链接> 题目大意:给出一个四面环海的凸多边形岛屿,求出这个岛屿中的点到海的最远距离. 解题分析: 仔细思考就会发现,其实题目其实就是让我们求该凸多边形内内切圆的最大半径是多少.但是,这个最大半径,没有什么比较好的求法,于是,我们可以想到二分答案求半径.对于二分的半径,我们可以将该凸多边形的边界向内平移 r 的距离,然后再用半平面交法,用这些平移后的直线去切割原凸多边形,如果最终切得的区域不为空,则二分枚举更大的半径,反之减小枚举的半径.知道恰好围成的区域为空(或恰好不为空)为止. #in…
Cows Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7038   Accepted: 3242 Description Your friend to the south is interested in building fences and turning plowshares into swords. In order to help with his overseas adventure, they are f…
pro:顺时针给定多边形,问是否可以放一个监控,可以监控到所有地方,即问是否存在多边形的核. 此题如果两点在同一边界上(且没有被隔段),也可以相互看到. sol:求多边形是否有核.先给直线按角度排序,然后增量法即可,复杂度O(NlogN). #include<iostream> #include<cmath> #include<algorithm> #include<cstdio> #define ll long long #define rep(i,a,b…