#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
typedef pair<ll,pll> ppl;
ll n;
ld x[1000009],y[1000009],u,L,R,eps;
bool can(ld R){
ld r=0.0;
for(int i=1;i<=n;i++){
if(R>=y[i]){
ld x0=x[i]-sqrt(R*R-y[i]*y[i]);
ld x1=x[i]+sqrt(R*R-y[i]*y[i]);
if(x0<=r+eps) r=max(x1,r);
if(r>=u-eps) return true;
}
}
return false;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin>>n>>u;
for(int i=1;i<=n;i++) cin>>x[i]>>y[i];
eps=0.0001;
L=0.0; R=1000000000.0;
while(L<R-eps){
ld mid=(L+R)*0.5;
if(can(mid)) R=mid;
else L=mid;
}
cout<<fixed<<setprecision(5)<<L;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
344 KB |
Output is correct |
2 |
Correct |
2 ms |
344 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
604 KB |
Output is correct |
2 |
Correct |
2 ms |
600 KB |
Output is correct |
3 |
Correct |
2 ms |
604 KB |
Output is correct |
4 |
Correct |
5 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
604 KB |
Output is correct |
2 |
Correct |
2 ms |
604 KB |
Output is correct |
3 |
Correct |
2 ms |
600 KB |
Output is correct |
4 |
Correct |
5 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
600 KB |
Output is correct |
2 |
Correct |
2 ms |
604 KB |
Output is correct |
3 |
Correct |
2 ms |
604 KB |
Output is correct |
4 |
Correct |
6 ms |
604 KB |
Output is correct |
5 |
Correct |
3 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
32 ms |
2820 KB |
Output is correct |
2 |
Correct |
29 ms |
2648 KB |
Output is correct |
3 |
Correct |
16 ms |
1996 KB |
Output is correct |
4 |
Correct |
87 ms |
2652 KB |
Output is correct |
5 |
Correct |
33 ms |
1880 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
56 ms |
2884 KB |
Output is correct |
2 |
Correct |
66 ms |
2648 KB |
Output is correct |
3 |
Correct |
83 ms |
2908 KB |
Output is correct |
4 |
Correct |
90 ms |
2940 KB |
Output is correct |
5 |
Correct |
112 ms |
3152 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
43 ms |
3160 KB |
Output is correct |
2 |
Correct |
30 ms |
2968 KB |
Output is correct |
3 |
Correct |
25 ms |
2908 KB |
Output is correct |
4 |
Correct |
136 ms |
3572 KB |
Output is correct |
5 |
Correct |
82 ms |
3160 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
47 ms |
3408 KB |
Output is correct |
2 |
Correct |
40 ms |
3416 KB |
Output is correct |
3 |
Correct |
33 ms |
3420 KB |
Output is correct |
4 |
Correct |
139 ms |
3596 KB |
Output is correct |
5 |
Correct |
114 ms |
3412 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
58 ms |
3596 KB |
Output is correct |
2 |
Correct |
44 ms |
3520 KB |
Output is correct |
3 |
Correct |
34 ms |
3416 KB |
Output is correct |
4 |
Correct |
148 ms |
3596 KB |
Output is correct |
5 |
Correct |
104 ms |
3412 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
286 ms |
16232 KB |
Output is correct |
2 |
Correct |
206 ms |
16104 KB |
Output is correct |
3 |
Correct |
179 ms |
15952 KB |
Output is correct |
4 |
Correct |
664 ms |
16008 KB |
Output is correct |
5 |
Correct |
500 ms |
16116 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
216 ms |
16116 KB |
Output is correct |
2 |
Correct |
272 ms |
16212 KB |
Output is correct |
3 |
Correct |
171 ms |
15960 KB |
Output is correct |
4 |
Correct |
633 ms |
15912 KB |
Output is correct |
5 |
Correct |
532 ms |
15956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
334 ms |
19028 KB |
Output is correct |
2 |
Correct |
237 ms |
19236 KB |
Output is correct |
3 |
Correct |
210 ms |
19456 KB |
Output is correct |
4 |
Correct |
878 ms |
19388 KB |
Output is correct |
5 |
Correct |
584 ms |
19236 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
301 ms |
19032 KB |
Output is correct |
2 |
Correct |
318 ms |
19252 KB |
Output is correct |
3 |
Correct |
214 ms |
19024 KB |
Output is correct |
4 |
Correct |
809 ms |
19044 KB |
Output is correct |
5 |
Correct |
675 ms |
19028 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
387 ms |
22356 KB |
Output is correct |
2 |
Correct |
299 ms |
22232 KB |
Output is correct |
3 |
Correct |
289 ms |
22176 KB |
Output is correct |
4 |
Correct |
944 ms |
22380 KB |
Output is correct |
5 |
Correct |
674 ms |
22352 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
332 ms |
22264 KB |
Output is correct |
2 |
Correct |
371 ms |
22284 KB |
Output is correct |
3 |
Correct |
256 ms |
22356 KB |
Output is correct |
4 |
Correct |
914 ms |
22376 KB |
Output is correct |
5 |
Correct |
781 ms |
32508 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
467 ms |
25640 KB |
Output is correct |
2 |
Correct |
346 ms |
25408 KB |
Output is correct |
3 |
Correct |
275 ms |
25444 KB |
Output is correct |
4 |
Execution timed out |
1027 ms |
25424 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
391 ms |
25320 KB |
Output is correct |
2 |
Correct |
400 ms |
25428 KB |
Output is correct |
3 |
Correct |
268 ms |
25376 KB |
Output is correct |
4 |
Execution timed out |
1050 ms |
25380 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
550 ms |
31568 KB |
Output is correct |
2 |
Correct |
370 ms |
31832 KB |
Output is correct |
3 |
Correct |
400 ms |
31732 KB |
Output is correct |
4 |
Execution timed out |
1041 ms |
31700 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
469 ms |
31568 KB |
Output is correct |
2 |
Correct |
484 ms |
31828 KB |
Output is correct |
3 |
Correct |
350 ms |
31572 KB |
Output is correct |
4 |
Execution timed out |
1076 ms |
31728 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |