谬悠 @ 2019-10-25 13:04:13
暴力枚举,,46分WA
QWQ
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
using namespace std;
int n;
struct node{
int l,r;
}a[200005];
inline bool com(node x,node y){
return x.l<y.l;
}
double maxn=2100000000.1;
double qiu(int a,int b,int c,int d){
return sqrt((a-c)*(a-c)+(b-d)*(b-d));
}
int main() {
cin>>n;
for(int i=1;i<=n;i++){
scanf("%d%d",&a[i].l,&a[i].r);
}
sort(a+1,a+1+n,com);
for(int i=1;i<=n;i++){
for(int j=i+1;j<=n;j++){
if(a[j].l-a[i].l>=maxn)break;
maxn=min(maxn,qiu(a[i].l,a[i].r,a[j].l,a[j].r));
}
}
printf("%0.4lf",maxn);
}
by Gogococoyoyo @ 2019-10-25 13:07:05
翻译:他WA了
by lx_zjk @ 2019-10-25 13:07:49
语文太好了
by Belarus @ 2019-10-25 13:08:06
会说话就出本书(
by YLWang @ 2019-10-25 13:50:46
翻译:他WA了
by encore @ 2019-10-25 14:12:58
暴力枚举为什么还来做加强版
by 谬悠 @ 2019-10-25 15:08:40
233,窝以为暴力可以做一下