Pagini recente » Cod sursa (job #570253) | Cod sursa (job #265961) | Cod sursa (job #1013508) | Cod sursa (job #1215765) | Cod sursa (job #977571)
Cod sursa(job #977571)
#include <cstdio>
#include <algorithm>
#include <cmath>
#define In "cmap.in"
#define Out "cmap.out"
#define Nmax 100004
#define x first
#define y second
using namespace std;
pair<int, int > Point[Nmax];
int N;
long long sol;
inline void Read()
{
freopen(In,"r",stdin);
freopen(Out,"w",stdout);
scanf("%d",&N);
for(int i = 1 ;i<=N;++i)
scanf("%d %d",&Point[i].x,&Point[i].y);
sort(Point+1,Point+N+1);
}
inline long long Dist(const int i,const int j)
{
return (Point[i].x-Point[j].x)*(Point[i].x-Point[j].x)+(Point[i].y-Point[j].y)*(Point[i].y-Point[j].y);
}
inline void Solve()
{
sol = (1LL<<60)-1;
int i, j;
long long x;
for(i = 1;i < N; ++i)
for(j = i+1 ;j <= N; ++j)
{
x = Dist(i,j);
if(x>=sol)
break;
sol = x;
}
}
inline void Write()
{
printf("%.6lf\n",sqrt(1.0*sol));
}
int main()
{
Read();
Solve();
Write();
return 0;
}