#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define float long double
const int MOD=1e9+7;
//const int MOD=998244353;
const int sqn=450;
const long double eps=1e-6;
long double n,l,x[1000002],y[1000002];
void runtc(){
cin>>n>>l;
for (int i=1;i<=n;i++){
cin>>x[i]>>y[i];
}
long double mini=0,maxi=3e9;
while (mini+eps<maxi){
long double mid=(mini+maxi)/2;
long double cur=0;
for (int i=1;i<=n;i++){
if (mid*mid<y[i]*y[i]) continue;
long double lol=sqrt(mid*mid-y[i]*y[i]);
if (x[i]-lol<=cur) cur=max(cur,x[i]+lol);
}
if (cur>=l) maxi=mid;
else mini=mid;
}
cout<<fixed<<setprecision(4);
cout<<maxi;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
//freopen("moocast.in","r",stdin);
//freopen("moocast.out","w",stdout);
//freopen("input1.in","r",stdin);
//freopen("output1.out","w",stdout);
//freopen("perfectly_balanced_chapter_1_input.txt","r",stdin);
//freopen("hackercup_output.txt","w",stdout);
int tc;
//cin>>tc;
tc=1;
for (int i=1;i<=tc;i++){
//cout<<"Case #"<<i<<": ";
runtc();
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
3 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
468 KB |
Output is correct |
2 |
Correct |
6 ms |
504 KB |
Output is correct |
3 |
Correct |
6 ms |
468 KB |
Output is correct |
4 |
Correct |
4 ms |
388 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
496 KB |
Output is correct |
2 |
Correct |
5 ms |
468 KB |
Output is correct |
3 |
Correct |
4 ms |
468 KB |
Output is correct |
4 |
Correct |
4 ms |
512 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
468 KB |
Output is correct |
2 |
Correct |
7 ms |
512 KB |
Output is correct |
3 |
Correct |
5 ms |
468 KB |
Output is correct |
4 |
Correct |
4 ms |
508 KB |
Output is correct |
5 |
Correct |
4 ms |
504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
62 ms |
2636 KB |
Output is correct |
2 |
Correct |
59 ms |
2732 KB |
Output is correct |
3 |
Correct |
37 ms |
2004 KB |
Output is correct |
4 |
Correct |
51 ms |
2688 KB |
Output is correct |
5 |
Correct |
30 ms |
1872 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
2772 KB |
Output is correct |
2 |
Correct |
64 ms |
2512 KB |
Output is correct |
3 |
Correct |
54 ms |
2892 KB |
Output is correct |
4 |
Correct |
53 ms |
2688 KB |
Output is correct |
5 |
Correct |
72 ms |
2984 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
64 ms |
3040 KB |
Output is correct |
2 |
Correct |
64 ms |
2900 KB |
Output is correct |
3 |
Correct |
59 ms |
2956 KB |
Output is correct |
4 |
Correct |
75 ms |
3404 KB |
Output is correct |
5 |
Correct |
54 ms |
3116 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
78 ms |
3412 KB |
Output is correct |
2 |
Correct |
89 ms |
3360 KB |
Output is correct |
3 |
Correct |
71 ms |
3404 KB |
Output is correct |
4 |
Correct |
77 ms |
3364 KB |
Output is correct |
5 |
Correct |
72 ms |
3404 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
86 ms |
3468 KB |
Output is correct |
2 |
Correct |
83 ms |
3388 KB |
Output is correct |
3 |
Correct |
70 ms |
3412 KB |
Output is correct |
4 |
Correct |
73 ms |
3460 KB |
Output is correct |
5 |
Correct |
67 ms |
3432 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
371 ms |
16032 KB |
Output is correct |
2 |
Correct |
404 ms |
15876 KB |
Output is correct |
3 |
Correct |
380 ms |
16076 KB |
Output is correct |
4 |
Correct |
378 ms |
16040 KB |
Output is correct |
5 |
Correct |
332 ms |
15988 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
416 ms |
15988 KB |
Output is correct |
2 |
Correct |
450 ms |
15948 KB |
Output is correct |
3 |
Correct |
341 ms |
15996 KB |
Output is correct |
4 |
Correct |
357 ms |
15988 KB |
Output is correct |
5 |
Correct |
338 ms |
15984 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
429 ms |
19124 KB |
Output is correct |
2 |
Correct |
486 ms |
19160 KB |
Output is correct |
3 |
Correct |
459 ms |
19040 KB |
Output is correct |
4 |
Correct |
446 ms |
19080 KB |
Output is correct |
5 |
Correct |
394 ms |
19020 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
490 ms |
19004 KB |
Output is correct |
2 |
Correct |
547 ms |
19032 KB |
Output is correct |
3 |
Correct |
396 ms |
19120 KB |
Output is correct |
4 |
Correct |
428 ms |
19092 KB |
Output is correct |
5 |
Correct |
400 ms |
19020 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
487 ms |
22296 KB |
Output is correct |
2 |
Correct |
541 ms |
22248 KB |
Output is correct |
3 |
Correct |
525 ms |
22244 KB |
Output is correct |
4 |
Correct |
493 ms |
22260 KB |
Output is correct |
5 |
Correct |
438 ms |
22188 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
556 ms |
22244 KB |
Output is correct |
2 |
Correct |
595 ms |
22248 KB |
Output is correct |
3 |
Correct |
509 ms |
22244 KB |
Output is correct |
4 |
Correct |
499 ms |
22292 KB |
Output is correct |
5 |
Correct |
483 ms |
22296 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
553 ms |
25376 KB |
Output is correct |
2 |
Correct |
625 ms |
25436 KB |
Output is correct |
3 |
Correct |
605 ms |
25324 KB |
Output is correct |
4 |
Correct |
576 ms |
25384 KB |
Output is correct |
5 |
Correct |
518 ms |
25268 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
639 ms |
25380 KB |
Output is correct |
2 |
Correct |
662 ms |
25380 KB |
Output is correct |
3 |
Correct |
534 ms |
25368 KB |
Output is correct |
4 |
Correct |
567 ms |
25396 KB |
Output is correct |
5 |
Correct |
520 ms |
25428 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
705 ms |
31708 KB |
Output is correct |
2 |
Correct |
819 ms |
31624 KB |
Output is correct |
3 |
Correct |
754 ms |
31624 KB |
Output is correct |
4 |
Correct |
710 ms |
31724 KB |
Output is correct |
5 |
Correct |
647 ms |
31624 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
782 ms |
31532 KB |
Output is correct |
2 |
Correct |
817 ms |
31692 KB |
Output is correct |
3 |
Correct |
685 ms |
31564 KB |
Output is correct |
4 |
Correct |
710 ms |
31564 KB |
Output is correct |
5 |
Correct |
652 ms |
31624 KB |
Output is correct |