# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
674539 | MacPhucKhang | Odašiljači (COCI20_odasiljaci) | C++17 | 13 ms | 340 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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();
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |