问题描述
P为笛卡尔平面上n>1个点构成的集合,求最近的两个点的距离(n=2^k)
思路解析
伪代码
程序原码
#include <bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
const int MAX = 1000;
struct points{
double x, y;
}P[MAX];
double dis(points& a, points& b) {
return pow(a.x - b.x, 2) + pow(a.y - b.y, 2);
}
int cmpx(points& a, points& b) {
return a.x < b.x;
}
double ecp