Cod sursa(job #1880406)
| Utilizator | Data | 15 februarie 2017 18:55:51 | |
|---|---|---|---|
| Problema | Cele mai apropiate puncte din plan | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.4 kb |
#include<bits/stdc++.h>
using namespace std;
struct p{int x,y;}v[100000];
int main(){
int n,i,j;
double d,dm;
fstream f;
f.open("cmap.in");
f>>n;
for(i=0;i<n;f>>v[i].x>>v[i].y,i++);
f.close();
dm=10e11;
for(i=0;i<n;i++)for(j=i+1;j<n;d=sqrt(pow(v[i].x-v[j].x,2)+pow(v[i].y-v[j].y,2)),dm=min(d,dm),j++);
f.open("cmap.out",ios_base::out);
f<<fixed<<setprecision(6)<<dm<<'\n';
f.close();
return 0;
}
