제출 #1078124

#제출 시각아이디문제언어결과실행 시간메모리
107812412345678Odašiljači (COCI20_odasiljaci)C++17
63 / 70
1098 ms460 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long const int nx=1e3+5; ll n, x[nx], y[nx], dsu[nx]; double l=0, r=2e9; int find(int x) { if (dsu[x]==x) return x; return dsu[x]=find(dsu[x]); } int main() { cin.tie(NULL)->sync_with_stdio(false); cin>>n; for (int i=1; i<=n ;i++) cin>>x[i]>>y[i]; while (r-l>1e-8) { double md=(l+r)/2; for (int i=1; i<=n; i++) dsu[i]=i; for (int i=1; i<=n; i++) { for (int j=i+1; j<=n; j++) if ((double)((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]))<=4*md*md) dsu[find(i)]=find(j); } int f=0; for (int i=1; i<=n; i++) if (find(i)!=find(1)) f=1; if (f) l=md; else r=md; } cout<<setprecision(8)<<l<<'\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...