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