平面上n个点,某点到其他点的切比雪夫距离之和最小。
表示不会下手,不过据说可以水过去,
1水,求出中心,按距中心的chebyshev距离排序,枚举前100个点,
2水,直接枚举 [n / 2 - k,n / 2 + k] 内的点;
在hdu上试了一下,k = 200的时候还WA,到k = 250就TLE了。k = 220 的时候可以AC
然后,又试着用法1水水,发现枚举前2个点就能水过去,一个是不可以的
#include <stdio.h>
#include <algorithm>
using namespace std;
#define N 100000
#define ENU 2
#define MAXA 1LL << 62
int sx,sy;
struct Point
{
int x,y;
void input()
{
scanf("%d%d",&x,&y);
sx += x;
sy += y;
}
}pt[N],p;
bool cmp(Point a,Point b)
{
return max(