# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
940674 | sleepntsheep | Mobile (BOI12_mobile) | C11 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
#define N 100000
int n, L;
double x[N], y[N];
int main()
{
scanf("%d%d",&n,&L);
for(int i=0;i<n;++i)scanf("%lf%lf",x+i,y+i);
double l=0,r=1e9;
for (int iter=200;iter--;)
{
double m=(l+r)/2,rr=0;
for(int i=0;i<n;++i)
{
if(m*m>=y[i]*y[i])
{
double dx=__builtin_sqrt(m*m-y[i]*y[i]);
if(x[i]-dx<=rr)
if(x[i]+dx>rr)rr=x[i]+dx;
}
}
if(rr>=L) r=m;
else l=m;
}
printf("%.6lf",r);
}