# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
881003 | TAhmed33 | Odašiljači (COCI20_odasiljaci) | C++98 | 4 ms | 348 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |