#include <bits/stdc++.h>
#define pldi pair <long double, int>
#define fi first
#define se second
using namespace std;
struct Coord{
int x, y;
};
int n;
vector <Coord> a;
vector <long double> d;
long double Distance(Coord i, Coord j){
return sqrt(pow(i.x - j.x, 2) + pow(i.y - j.y, 2));
}
void Solve(){
long double ans = -INFINITY;
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++){
if (i == j) continue;
long double temp = Distance(a[i], a[j]);
d[i] = min(d[i], temp);
}
for (auto i : d) ans = max(ans, i);
cout << fixed << setprecision(7) << (n <= 1 ? 0 :ans / 2);
}
int main(){
cin >> n;
a.resize(n);
d.resize(n, INFINITY);
for (auto &i : a)
cin >> i.x >> i.y;
Solve();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
300 KB |
Output is correct |
5 |
Correct |
1 ms |
300 KB |
Output is correct |
6 |
Incorrect |
3 ms |
212 KB |
Output isn't correct |
7 |
Correct |
4 ms |
212 KB |
Output is correct |
8 |
Incorrect |
6 ms |
340 KB |
Output isn't correct |
9 |
Incorrect |
13 ms |
340 KB |
Output isn't correct |
10 |
Correct |
11 ms |
336 KB |
Output is correct |