제출 #881003

#제출 시각아이디문제언어결과실행 시간메모리
881003TAhmed33Odašiljači (COCI20_odasiljaci)C++98
70 / 70
4 ms348 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int n; pair <ll, ll> a[1001]; ll dist (int x, int y) { return (a[x].first - a[y].first) * (a[x].first - a[y].first) + (a[x].second - a[y].second) * (a[x].second - a[y].second); } ll b[1001]; bool vis[1001]; const ll inf = 1e18; int main () { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i].first >> a[i].second; for (int i = 1; i <= n; i++) b[i] = inf - 1; ll mx = 0; for (int i = 1; i <= n; i++) { ll pos = -1, mn = inf; for (int j = 1; j <= n; j++) { if (vis[j]) continue; if (b[j] < mn) { mn = b[j]; pos = j; } } if (i != 1) mx = max(mx, b[pos]); vis[pos] = 1; for (int j = 1; j <= n; j++) { if (!vis[j]) { b[j] = min(b[j], dist(pos, j)); } } } cout << fixed << setprecision(7) << sqrt(mx) / 2 << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...