Pagini recente » Cod sursa (job #858344) | Cod sursa (job #1734747) | Cod sursa (job #2389346) | Cod sursa (job #107983) | Cod sursa (job #982022)
Cod sursa(job #982022)
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;
}
int dist(pair <int,int> a,pair <int,int> b)
{
return (a.first-b.first)*(a.first-b.first)+(a.second-b.second)*(a.second-b.second);
}
double Solve()
{
int min=2000000000;
for(int i=1;i<=N-1;i++)
for(int j=i+1;j<=N;j++)
{
int a=dist(P[i],P[j]);
if(a<min)
min=a;
}
return min;
}
int main()
{
Read();
tu<<fixed<<setprecision(6)<<sqrt(Solve());
return 0;
}