题目链接:POJ 3130 Problem Description After counting so many stars in the sky in his childhood, Isaac, now an astronomer and a mathematician uses a big astronomical telescope and lets his image processing program count stars. The hardest part of the prog…
Description After counting so many stars in the sky in his childhood, Isaac, now an astronomer and a mathematician uses a big astronomical telescope and lets his image processing program count stars. The hardest part of the program is to judge if shi…
/* 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…
题意:逆时针给出N个点,求这个多边形是否有核. 思路:半平面交求多边形是否有核.模板题. 定义: 多边形核:多边形的核可以只是一个点,一条直线,但大多数情况下是一个区域(如果是一个区域则必为 ).核内的点与多边形所有顶点的连线均在多边形内部. 半平面交:对于平面,任何直线都能将平面划分成两部分,即两个半平面.半平面交既是多个半平面的交集.定义如其名. 半平面交求多边形的核. 设多边形点集为 *p,核的点集为*cp. 开始时将p的所有点放到cp内,然后枚举多边形的所有边去切割cp,cp中在边内侧的…
http://poj.org/problem?id=3130 #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #define maxn 1000000 using namespace std; ); struct point { double x,y; }; double a,b,c; ,m; point p1[maxn]; point p2[maxn];…
题目链接 题意 : 给你一个多边形,问你该多边形中是否存在一个点使得该点与该多边形任意一点的连线都在多边形之内. 思路 : 与3335一样,不过要注意方向变化一下. #include <stdio.h> #include <string.h> #include <iostream> #include <math.h> using namespace std ; struct node { double x; double y ; } p[],temp[],n…
求多边形的核,直接把所有边求半平面交判断有无即可 #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> using namespace std; const int N=205; const double eps=1e-6; int n; struct dian { double x,y; dian(double X=0,double Y=0) { x=X,y=Y; }…
题目链接 题意 : 给你一个多边形,问你里边能够盛的下的最大的圆的半径是多少. 思路 :先二分半径r,半平面交向内推进r.模板题 #include <stdio.h> #include <string.h> #include <iostream> #include <math.h> ; using namespace std ; struct node { double x; double y ; } p[],temp[],newp[];//p是最开始的多边…
Rotating Scoreboard Description This year, ACM/ICPC World finals will be held in a hall in form of a simple polygon. The coaches and spectators are seated along the edges of the polygon. We want to place a rotating scoreboard somewhere in the hall su…
Most Distant Point from the Sea Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 3476   Accepted: 1596   Special Judge Description The main land of Japan called Honshu is an island surrounded by the sea. In such an island, it is natural t…