分治,在平面上找距离最近的两个点

#include 
#include 
#include 
#include 
#include 
#include 

using namespace std;

const double eps = 1e-8;
const int INF = 0x7fffffff;

int n;

struct Point
{
	double x,y;
}p[200000+5];
Point temp[200000+5];

bool cmpy(Point a, Point b)
{
	return a.y < b.y;
}
bool cmpx(Point a,Point b){  //先把n个点从左到右排序一波
    if(a.x!=b.x)
        return a.x>1;
	//cout << left <<"    "<< right <<" 进入到   "<>n;
	for(int i=0; i

你可能感兴趣的:(算法)