分而治之,一般是nlogn的复杂度,所以用分治来求最近点对
#include#include #include #include #include #define INF 0x3f3f3f3fusing namespace std;struct node{ double x,y;};node co[100100];node co1[100100];int N;double distance(int i,int j,node co[]){ return sqrt( (co[i].x-co[j].x)*(co[i].x-co[j].x)+(co[i].y-co[j].y)*(co[i].y-co[j].y) );}int cmpy(node a,node b){ return a.y