#include <bits/stdc++.h>
using namespace std;
long double dist(int x1, int y1, int x2, int y2) {
cout << setprecision(10); long double ans = pow((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2), 0.5);
return ans;
}
int main() {
int n; cin >> n;
vector<pair<int, int>> a(n);
for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
long double ans = 0;
for (int i = 0; i < n; i++) {
long double mindist = dist(a[i].first, a[i].second, a[(i+1)%n].first, a[(i+1)%n].second);
for (int j = 0; j < n; j++) {
if (i != j) {
mindist = min(mindist, dist(a[i].first, a[i].second, a[j].first, a[j].second));
}
}
ans = max(ans, mindist);
}
cout << setprecision(10) << ans/2.0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |