#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=2e9;
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 |
0 ms |
340 KB |
Output is correct |
# |
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 |
0 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 |
2 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
468 KB |
Output is correct |
2 |
Correct |
5 ms |
496 KB |
Output is correct |
3 |
Correct |
4 ms |
468 KB |
Output is correct |
4 |
Correct |
4 ms |
468 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
468 KB |
Output is correct |
2 |
Correct |
5 ms |
468 KB |
Output is correct |
3 |
Correct |
3 ms |
468 KB |
Output is correct |
4 |
Correct |
4 ms |
504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
468 KB |
Output is correct |
2 |
Correct |
6 ms |
508 KB |
Output is correct |
3 |
Correct |
3 ms |
468 KB |
Output is correct |
4 |
Correct |
4 ms |
468 KB |
Output is correct |
5 |
Correct |
3 ms |
468 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
58 ms |
2592 KB |
Output is correct |
2 |
Correct |
59 ms |
2680 KB |
Output is correct |
3 |
Correct |
39 ms |
1928 KB |
Output is correct |
4 |
Correct |
50 ms |
2692 KB |
Output is correct |
5 |
Correct |
28 ms |
1892 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
45 ms |
2772 KB |
Output is correct |
2 |
Correct |
46 ms |
2472 KB |
Output is correct |
3 |
Correct |
51 ms |
2876 KB |
Output is correct |
4 |
Correct |
52 ms |
2808 KB |
Output is correct |
5 |
Correct |
58 ms |
3020 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
61 ms |
3080 KB |
Output is correct |
2 |
Correct |
64 ms |
2904 KB |
Output is correct |
3 |
Correct |
55 ms |
2984 KB |
Output is correct |
4 |
Correct |
68 ms |
3324 KB |
Output is correct |
5 |
Correct |
52 ms |
3116 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
74 ms |
3392 KB |
Output is correct |
2 |
Correct |
78 ms |
3352 KB |
Output is correct |
3 |
Correct |
65 ms |
3456 KB |
Output is correct |
4 |
Correct |
69 ms |
3404 KB |
Output is correct |
5 |
Correct |
62 ms |
3408 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
80 ms |
3336 KB |
Output is correct |
2 |
Correct |
77 ms |
3416 KB |
Output is correct |
3 |
Correct |
66 ms |
3424 KB |
Output is correct |
4 |
Correct |
71 ms |
3456 KB |
Output is correct |
5 |
Correct |
61 ms |
3460 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
343 ms |
15984 KB |
Output is correct |
2 |
Correct |
396 ms |
16036 KB |
Output is correct |
3 |
Correct |
371 ms |
15948 KB |
Output is correct |
4 |
Correct |
346 ms |
15896 KB |
Output is correct |
5 |
Correct |
318 ms |
15980 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
389 ms |
15968 KB |
Output is correct |
2 |
Correct |
422 ms |
15948 KB |
Output is correct |
3 |
Correct |
329 ms |
15932 KB |
Output is correct |
4 |
Correct |
336 ms |
15896 KB |
Output is correct |
5 |
Correct |
326 ms |
15940 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
417 ms |
19232 KB |
Output is correct |
2 |
Correct |
454 ms |
19188 KB |
Output is correct |
3 |
Correct |
455 ms |
19020 KB |
Output is correct |
4 |
Correct |
422 ms |
19060 KB |
Output is correct |
5 |
Correct |
378 ms |
19084 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
455 ms |
19032 KB |
Output is correct |
2 |
Correct |
501 ms |
19168 KB |
Output is correct |
3 |
Correct |
388 ms |
19124 KB |
Output is correct |
4 |
Correct |
424 ms |
19248 KB |
Output is correct |
5 |
Correct |
383 ms |
19124 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
483 ms |
22220 KB |
Output is correct |
2 |
Correct |
527 ms |
22224 KB |
Output is correct |
3 |
Correct |
519 ms |
22196 KB |
Output is correct |
4 |
Correct |
491 ms |
22220 KB |
Output is correct |
5 |
Correct |
455 ms |
22132 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
550 ms |
22132 KB |
Output is correct |
2 |
Correct |
572 ms |
22296 KB |
Output is correct |
3 |
Correct |
461 ms |
22248 KB |
Output is correct |
4 |
Correct |
520 ms |
22256 KB |
Output is correct |
5 |
Correct |
447 ms |
22220 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
553 ms |
25496 KB |
Output is correct |
2 |
Correct |
615 ms |
25420 KB |
Output is correct |
3 |
Correct |
590 ms |
25416 KB |
Output is correct |
4 |
Correct |
561 ms |
25364 KB |
Output is correct |
5 |
Correct |
512 ms |
25420 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
608 ms |
25440 KB |
Output is correct |
2 |
Correct |
643 ms |
25292 KB |
Output is correct |
3 |
Correct |
529 ms |
25532 KB |
Output is correct |
4 |
Correct |
559 ms |
25280 KB |
Output is correct |
5 |
Correct |
512 ms |
25296 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
690 ms |
31724 KB |
Output is correct |
2 |
Correct |
755 ms |
31592 KB |
Output is correct |
3 |
Correct |
749 ms |
31740 KB |
Output is correct |
4 |
Correct |
701 ms |
31692 KB |
Output is correct |
5 |
Correct |
636 ms |
31624 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
748 ms |
31620 KB |
Output is correct |
2 |
Correct |
795 ms |
31672 KB |
Output is correct |
3 |
Correct |
670 ms |
31692 KB |
Output is correct |
4 |
Correct |
716 ms |
31596 KB |
Output is correct |
5 |
Correct |
680 ms |
31620 KB |
Output is correct |