poj 2079 Triangle(旋转卡壳)】的更多相关文章

Triangle Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 9525   Accepted: 2845 Description Given n distinct points on a plane, your task is to find the triangle that have the maximum area, whose vertices are from the given points. Input…
求点集中面积最大的三角形...显然这个三角形在凸包上... 但是旋转卡壳一般都是一个点卡另一个点...这种要求三角形的情况就要枚举底边的两个点 卡另一个点了... 随着底边点的递增, 最大点显然是在以l(i,j)为底边进行卡壳旋转 但分析了一下这种卡壳的复杂度到了O(n^2) 感觉不太靠谱...不知道有没有更强的方法...我感觉两个点卡的时候都是凸函数...不是很好卡的样子...如果我想到了我再更新这贴... /********************* Template ***********…
Triangle Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 8917   Accepted: 2650 Description Given n distinct points on a plane, your task is to find the triangle that have the maximum area, whose vertices are from the given points. Input…
Triangle Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 7625   Accepted: 2234 Description Given n distinct points on a plane, your task is to find the triangle that have the maximum area, whose vertices are from the given points. Input…
Triangle Time Limit: 3000MS   Memory Limit: 30000KB   64bit IO Format: %I64d & %I64u Submit Status Description English Vietnamese Given n distinct points on a plane, your task is to find the triangle that have the maximum area, whose vertices are from…
给出一个点集,求顶点在点集中的最大的三角形面积. 我们知道这三角形的三个点肯定在凸包上,我们求出凸包之后不能枚举,由于题目n比較大,枚举的话要O(n^3)的数量级,所以採用旋转卡壳的做法: 首先枚举三角形的第一个顶点i, 初始化第二个顶点j=i+1和第三个顶点k=j+1,对k进行循环,直到找到第一个k使得cross(i,j,k)>cross(i,j,k+1),假设k==i进入下一次循环. 对j,k进行旋转.每次循环之前更新最大值,然后固定一个j,相同找到一个k使得cross(i,j,k)>cr…
题链: http://poj.org/problem?id=2079 题解: 计算几何,凸包,旋转卡壳 复杂度O(N^2),(O(N)什么的就不说了,我觉得我看过的O(N)方法正确性都有问题,虽然有些AC了,那应该是鲁棒性太强了,谁叫他们非要每挪动一步都取MAX的呢) 做法: (三角形的三个顶点在凸包的顶点上,同时显然三角形的底边不一定为凸包的边啦!) 枚举i,j两点,使得有向线段$\vec{ij}$作为三角形底边. 然后在有向线段$\vec{ij}$的右侧区域(凸包上),寻找k点使得三角形ij…
思路: 求个凸包 旋转卡壳一下 就求出来最远点对了 注意共线情况 也就是说   凸包如果有一堆点共线保留端点即可 //By SiriusRen #include <cmath> #include <cstdio> #include <algorithm> using namespace std; ; ,ans; struct P{int x,y;P(){}P(int X,int Y){x=X,y=Y;}}p[N],tb[N]; bool cmp(P a,P b){ret…
[题目链接] http://poj.org/problem?id=2079 [题目大意] 给出一些点,求出能组成的最大面积的三角形 [题解] 最大三角形一定位于凸包上,因此我们先求凸包,再在凸包上计算, 因为三角形在枚举了一条固定边之后,图形面积随着另一个点的位置变换先变大后变小 因此我们发现面积递减之后就移动固定边. [代码] #include <cstdio> #include <algorithm> #include <cmath> #include <ve…
Triangle Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 9835   Accepted: 2951 Description Given n distinct points on a plane, your task is to find the triangle that have the maximum area, whose vertices are from the given points. Input…