地址:http://poj.org/problem?id=1279 题目: Art Gallery Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 7329   Accepted: 2938 Description The art galleries of the new and very futuristic building of the Center for Balkan Cooperation have the f…
给出三个半平面交的裸题. 不会的上百度上谷(gu)歌(gou)一下. 毕竟学长的语文是体育老师教的.(卡格玩笑,别当真.) 这种东西明白就好,代码可以当模板. //poj1474 Video Surveillance //点集默认顺时针 //算法参考:http://www.cnblogs.com/huangxf/p/4067763.html #include<cstdio> #include<cmath> using namespace std; ; struct point{ d…
题目大意: 给定n,接下来n行逆时针给定小岛的n个顶点 输出岛内离海最远的点与海的距离 半平面交模板题 将整个小岛视为由许多半平面围成 那么以相同的比例缩小这些半平面 一直到缩小到一个点时 那个点就是离海最远的点 #include <cstdio> #include <cmath> #include <vector> #include <algorithm> using namespace std; ; double add(double a,double…
题目大意 给你n个凸多边形,求多边形的交的面积 分析 题意\(=\)给你一堆边,让你求半平面交的面积 做法 半平面交模板 1.定义半平面为向量的左侧 2.将所有向量的起点放到一个中心,以中心参照进行逆时针极角排序 但是直接按叉积排序会转圈圈 于是我们从\(x\)轴负半轴开始逆时针旋转,将坐标轴分为上下两部(\(x\)轴属于下部) 当两个向量终点的\(y\)都在x轴上时,按x从小到大排 当两个向量终点同在上部/同在下部时,按叉积排(平行按左右排) 当一上一下时,下部的排前 注意:快排时像我这样贪方…
题意:求多边形的核的面积. 敲一下半平面交模板........  然后我wa了一早上就因为写了%lf  不知道poj什么破机制还不能用lf的,真的想跳楼 #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #define MN 50000 #define eps 1e-10 using namespace std; inline int read() { , f =…
摘自http://blog.csdn.net/accry/article/details/6070621 首先解决问题:什么是半平面? 顾名思义,半平面就是指平面的一半,我们知道,一条直线可以将平面分为两个部分,那么这两个部分就叫做两个半平面. 然后,半平面怎么表示呢? 二维坐标系下,直线可以表示为ax + by + c = 0,那么两个半平面则可以表示为ax + by + c >= 0 和ax + by + c < 0,这就是半平面的表示方法. 还有,半平面的交是神马玩意? 其实就是一个方程…
#include<iostream> #include<cstdio> #include<algorithm> #include<cmath> using namespace std; const int N=505; int d,b,n,m; struct dian { double x,y; dian(double X=0,double Y=0) { x=X,y=Y; } dian operator + (const dian &a) const…
#include<cstdio> #include<algorithm> #define LDB long double using namespace std; ]; struct lin{ LDB k,b; int num; }a[]; struct rec{ LDB inte; int num; }sta[]; int mycomp(const lin &a,const lin &b){ ); ); ); ); } LDB inter(lin a,lin b)…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1757 按照题目的要求构造矩阵 //Author: xiaowuga //矩阵: //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 9 // 1 0 0 0 0 0 0 0 0 0 8 // 0 1 0 0 0 0 0 0 0 0 7 // 0 0 1 0 0 0 0 0 0 0 6 // 0 0 0 1 0 0 0 0 0 0 5 // 0 0 0 0 1 0 0 0 0 0 4 //…
POJ1279 给一个多边形 求它的核的面积 所谓多边形的核 是多边形中的一个点集 满足其中的点与多边形边上的点的连线全部在多边形中 用多边形的每一条边所在的直线去切整个坐标平面 得到的一个凸包就是核 #include<iostream> #include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #include<algorithm> #inclu…