Pagini recente » Cod sursa (job #689582) | Cod sursa (job #2642010) | Cod sursa (job #592200) | Cod sursa (job #1941913) | Cod sursa (job #982019)
Cod sursa(job #982019)
using namespace std;
#include<fstream>
#include<iomanip>
#include<cmath>
ifstream eu("cmap.in");
ofstream tu("cmap.out");
# define Nmax 100005
pair <int,int> P[Nmax];
int N;
void Read()
{
eu>>N;
for(int i=1;i<=N;i++)
eu>>P[i].first>>P[i].second;
}
double dist(pair <int,int> a,pair <int,int> b)
{
return sqrtl((a.first-b.first)*(a.first-b.first)+(a.second-b.second)*(a.second-b.second));
}
double Solve()
{
double min=2000000000;
for(int i=1;i<=N-1;i++)
for(int j=i+1;j<=N;j++)
{
double a=dist(P[i],P[j]);
if(a<min)
min=a;
}
return min;
}
int main()
{
Read();
tu<<fixed<<setprecision(6)<<Solve();
return 0;
}