bzoj 1604: [Usaco2008 Open]Cow Neighborhoods 奶牛的邻居【切比雪夫距离+并查集+multiset】...
参考:http://hzwer.com/4361.html坐标开longlong,inf开大点先曼哈顿转切比雪夫(x+y,x-y),距离就变成了max(x',y');先按x排序,维护两个指针,指针内区间的x差总是#include#include#includeusingnamespacestd;constintN=100005;constlonglonginf=1e15;intn,m,f[N],c