Pagini recente » Cod sursa (job #234819) | Cod sursa (job #3273916) | Cod sursa (job #3235550) | Cod sursa (job #1092955) | Cod sursa (job #2032819)
#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
ifstream f("cmap.in");
ofstream g("cmap.out");
pair<double,double> v[1<<17];
double D(int a,int b){return sqrt(pow((v[a].x-v[b].x),2)+pow((v[a].y-v[b].y),2));}
int n;double t;
int main(){
f>>n;
for(int i=1;i<=n;++i) f>>v[i].x>>v[i].y;
sort(v+1,v+n+1);t=1000000000;
for(int i=1;i<=n;++i) for(int j=i+1;j<=n;++j){if(v[j].x-v[i].x>t) break;t=min(t,D(i,j));}
g<<fixed<<setprecision(6)<<t;return 0;}