Submission #940674

#TimeUsernameProblemLanguageResultExecution timeMemory
940674sleepntsheepMobile (BOI12_mobile)C11
Compilation error
0 ms0 KiB
#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); }

Compilation message (stderr)

mobile.c: In function 'main':
mobile.c:9:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     scanf("%d%d",&n,&L);
      |     ^~~~~~~~~~~~~~~~~~~
mobile.c:10:25: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     for(int i=0;i<n;++i)scanf("%lf%lf",x+i,y+i);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccz22ff6.o: in function `main':
mobile.c:(.text.startup+0x1d4): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status