#include<bits/stdc++.h>
using namespace std;
#define int double
typedef long long ll;
#define double long double
using ii = pair<int, int>;
vector<ii> points, pointsy;
inline double dist(ii a, ii b) {
return sqrt(pow(a.first - b.first, 2.0) + pow(a.second - b.second, 2.0));
}
constexpr double INF = 1e12;
signed main() {
signed n; cin >> n;
for (signed i = 0; i < n; i++) {
int x, y; cin >> x >> y;
points.push_back({x, y});
}
// // sort by increasing y
// sort(points.begin(), points.end(), [](const ii&a, const ii&b)
// {
// return a.second<b.second;
// });
double global_ans = 0;
for (signed i = 0; i < n; i++) {
auto p1 = points[i];
double local_ans = INF;
for (signed j = 0; j < n; j++) {
if (i==j) continue;
auto p2 = points[j];
local_ans = min(local_ans, dist(p1, p2));
}
global_ans = max(global_ans, local_ans / 2);
}
cout << setprecision(7) << global_ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |