RT,注意考虑凸包点数小于3的情况View Code #include<stdio.h>#include<string.h>#include<algorithm>#include<math.h>using namespace std;#define eps 1e-8#define inf 1<<29struct point{ int x, y; point(){} point(int xx, int yy) : x(xx), y(yy){}};struct data{ int x, y, v, l;}d[16];int det(int Read More
posted @ 2012-09-01 20:21
To be an ACMan
Views(236)
Comments(0)
Diggs(0)
题意:给你一些点,这些点里面一定有(0,0)原点,并且没有第二象限中的点,这些点是一个凸包,让你按极角序输出这些点。就排序,比较水,没凸包真扫兴View Code #include<stdio.h>#include<string.h>#include<algorithm>#include<math.h>using namespace std;#define eps 1e-8#define inf 1<<29struct point{ int x, y;}p[52];int det(int x1, int y1, int x2, int Read More
posted @ 2012-09-01 15:37
To be an ACMan
Views(341)
Comments(0)
Diggs(0)
题意:国王想建一个周长最短的城墙,使墙的任意一点到城墙的距离都 > l。求这面墙的周长。不难发现题目要求的就是 凸包的周长+半径为l圆的周长。不清楚Graham-scan算法的两种排序概念的可以去看看lrj的黑书,黑书介绍了两种排序方法来实现Graham-scan算法。1. 极角序 (看了lrj的黑书就知道这个排序不能解决某些共线问题,有一定的缺陷,但这题反映不出它的缺陷)View Code #include<stdio.h>#include<string.h>#include<algorithm>#include<math.h>using Read More
posted @ 2012-09-01 14:42
To be an ACMan
Views(1500)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号