摘要: 题目大意就是最大点对距,最大点对距的两端点一定是凸包顶点,所以找出形成凸包所需要的最少顶点,然后遍历找出最大点对距。对凸包算法的详细讲解:http://www.cnblogs.com/Booble/archive/2011/03/10/1980089.html#include<iostream>#include<cstdio>using namespace std;struct point{ int x,y;};point vertex[500000],res[500000];int cmp(const void * a,const void* b){ point p1 阅读全文
posted @ 2011-11-12 20:20 书山有路,学海无涯 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 题意:给出一个去掉几个点后的凸包,判断是不是原始凸包。看了大牛的思想后才知道:只要判断凸包的每个边上有三个顶点,就可以判断该凸包为原始凸包。1、少于六个点不可能是原始凸包。2、利用graham算法找出形成该凸包至少需要的顶点,存进数组res[]中,剩余的存进leave[]数组中。3、遍历两个数组判断是否满足条件。#include<iostream>#include<cstdio>using namespace std;#define MAX_INT 123456789struct point{ int x,y;};point vertex[1000];int res[1 阅读全文
posted @ 2011-11-12 08:39 书山有路,学海无涯 阅读(657) 评论(0) 推荐(0) 编辑