Pagini recente » Cod sursa (job #3241694) | Cod sursa (job #1866547) | Cod sursa (job #2362671) | Cod sursa (job #2533739) | Cod sursa (job #1151041)
#include <cmath>
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
#define LL long long
#define x first
#define y second
#define INF (1LL << 62)
#define MAXN 100000
ifstream f("cmap.in");
ofstream g("cmap.out");
int n;
pair<LL, LL> pt[MAXN];
LL dist(int i, int j) {
return 1LL * (pt[i].x - pt[j].x) * (pt[i].x - pt[j].x) + 1LL * (pt[i].y - pt[j].y) * (pt[i].y - pt[j].y);
}
int main()
{
f >> n;
for (int i = 1; i <= n; i++) {
f >> pt[i].x >> pt[i].y;
}
LL mn = INF;
for (int i = 1; i < n; i++) {
for (int j = i + 1; j <= n; j++) {
mn = min(mn, dist(i, j));
}
}
g << fixed << setprecision(6) << sqrt(mn) << '\n';
f.close();
g.close();
return 0;
}