Submission #674539

#TimeUsernameProblemLanguageResultExecution timeMemory
674539MacPhucKhangOdašiljači (COCI20_odasiljaci)C++17
42 / 70
13 ms340 KiB
#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 timeMemoryGrader output
Fetching results...