【kuangbin专题】计算几何_凸包】的更多相关文章

1.poj1113 Wall 题目:http://poj.org/problem?id=1113 题意:用一条线把若干个点包起来,并且线距离任何一个点的距离都不小于r.求这条线的最小距离是多少? 分析:这道题的答案是凸包周长加上一个圆周长,即包围凸包的一个圆角多边形,但是没弄明白那些圆角加起来为什么恰好是一个圆.每个圆角是以凸包对应的顶点为圆心,给定的L为半径,与相邻两条边的切点之间的一段圆弧.每个圆弧的两条半径夹角与对应的凸包的内角互补.假设凸包有n条边,则所有圆弧角之和为180°*n-180…
任选一个点作为起始点,将其他点按与该点连线的极角排序,二分查询点在哪两个射线之间, 并特别判断一下边界即可. Code: #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> #define setIO(s) freopen(s".in","r",stdin) #define maxn 200000 const double…
蛋疼的蚂蚁 Time Limit: 1000 MS     Memory Limit: 65536 K Total Submit: 39(22 users)    Total Accepted: 26(21 users) Rating: Special Judge: No Description 大千世界无奇不有,最近科学家发现一种蚂蚁,它头部只有一只左眼,并且 三只脚在身子的右侧,因此:1,它不能转向右侧.2,它的行走会留下一条红印.3,它行走不会在经过以前 走过的红印. 这种蚂蚁需要每天吃一…
Space Ant Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 2876   Accepted: 1839 Description The most exciting space discovery occurred at the end of the 20th century. In 1999, scientists traced down an ant-like creature in the planet Y19…
kuangbin专题链接:https://vjudge.net/article/752 kuangbin专题十二 基础DP1 题解+总结:https://www.cnblogs.com/RioTian/p/13110438.html 最小生成算法 介绍 和 模板 次最小生成树:介绍及模板 总结: 文章目录 目录 总结: 1.Jungle Roads 2.Networking prim 算法 kruskal算法 3.Constructing Roads 4.Agri-Net 5.The Uniqu…
1.poj3335 Rotating Scoreboard 传送:http://poj.org/problem?id=3335 题意:就是有个球场,球场的形状是个凸多边形,然后观众是坐在多边形的边上的,问你是否在球场上有个地方可以放一个记分牌,然后所有的观众都可以看得到的. 分析:多边形是否存在内核. #include<iostream> #include<algorithm> #include<cstring> #include<cmath> using…
链接:https://cn.vjudge.net/contest/68968 POJ 2318 TOYS 题意:m个玩具落在n+1个区间,给你玩具的坐标,问每个区间有多少玩具. 思路:叉积的简单应用,用叉积判断在直线的哪一侧,因为是顺序给出坐标,所以从左往右判断即可. AC代码: #include<cstdio> #include<cmath> #include<algorithm> using namespace std; ; int U[maxn], L[maxn]…
这道题是水题,发现平移某些边,答案就是圆心的凸包+一个圆的周长. 不要忽视精度误差! #include <algorithm> #include <iostream> #include <cstring> #include <cstdio> #include <cmath> using namespace std; ; ; const double Pi=acos(-1.0); int sgn(double x){ ; ; ; } struct…
1.poj2318 TOYS 传送:http://poj.org/problem?id=2318 题意:有m个点落在n+1个区域内.问落在每个区域的个数. 分析:二分查找落在哪个区域内.叉积判断点与线段的位置. #include<iostream> #include<cstring> #include<algorithm> using namespace std; ; struct point{ int x,y; point(){ } point(int _x,int…
二维几何部分 // `计算几何模板` ; const double inf = 1e20; const double pi = acos(-1.0); ; //`Compares a double to zero` int sgn(double x){ ; ); ; } //square of a double inline double sqr(double x){return x*x;} /* * Point * Point() - Empty constructor * Point(dou…