poj_2187求凸包直径】的更多相关文章

#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> using namespace std; struct Point{ int x,y; Point(int x=0,int y=0):x(x),y(y){} }; typedef Point Vector; bool cmp(const Point &p,con…
旋转卡壳求凸包直径. 参考:http://www.cppblog.com/staryjy/archive/2010/09/25/101412.html #include <cstdio> #include <cmath> #include <algorithm> using namespace std; << ; struct Point { int x, y; Point( , ):x(x), y(y) { } }; typedef Point Vecto…
链接: http://poj.org/problem?id=2187 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22013#problem/E Beauty Contest Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 24254   Accepted: 7403 Description Bessie, Farmer John's prize cow, h…
给定点集的最远两点的距离. 先用graham求凸包.旋(xuán)转(zhuàn)卡(qiǎ)壳(ké)求凸包直径. ps:旋转卡壳算法的典型运用 http://blog.csdn.net/hanchengxi/article/details/8639476. #include <cstdio> #include <cmath> #include <algorithm> #define sqr(x) (x)*(x) #define N 50001 using names…
旋转卡壳求凸包的直径的平方 板子题 #include<cstdio> #include<vector> #include<cmath> #include<algorithm> using namespace std; struct Point { int x, y; Point(int x=0, int y=0):x(x),y(y) { } }; typedef Point Vector; Vector operator - (const Point&…
#include<iostream> #include<cstdio> #include<cmath> #include<vector> #include<algorithm> using namespace std; struct Point { int x, y; Point(int x=0, int y=0):x(x),y(y) { } }; typedef Point Vector; Vector operator - (const Po…
G++一直没有过了 换成 C++果断A掉了...It's time to bet RP. 题意:给一个多边形,然后放进去两个圆,让两个圆的覆盖面积尽量最大,输出两个圆心的坐标. 思路:将多边形的边向里平移圆的的半径R,然后求新多边形的距离最长的两个点. 平移多少废了一点脑筋,其他的就都是现成的模板了. 这个是平移的函数,自己想得,不知道还有没有更简便的.左右平移只需要改一下 向量 V void Panning_Edge(P &a1,P &a2,double dis) { //向v的右侧平移…
Beauty Contest Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 26180   Accepted: 8081 Description Bessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'. As a result, Bess…
1.HDU 1392 Surround the Trees 2.题意:就是求凸包周长 3.总结:第一次做计算几何,没办法,还是看了大牛的博客 #include<iostream> #include<cstring> #include<cmath> #include<queue> #include<algorithm> #include<cstdio> #include<cstdlib> #define F(i,a,b) f…
http://poj.org/problem?id=1113 题目大意:现在要给n个点,让你修一个围墙把这些点围起来,距离最小是l 分析  :现在就是求凸包的周长然后再加上一个圆的周长 #include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> #include<algorithm> #include<iostream> #include<qu…