#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-4;
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]<0) 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();
}
}
# |
결과 |
실행 시간 |
메모리 |
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 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
0 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
436 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 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
468 KB |
Output is correct |
2 |
Correct |
4 ms |
468 KB |
Output is correct |
3 |
Correct |
4 ms |
468 KB |
Output is correct |
4 |
Correct |
3 ms |
468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
468 KB |
Output is correct |
2 |
Correct |
4 ms |
468 KB |
Output is correct |
3 |
Correct |
4 ms |
468 KB |
Output is correct |
4 |
Correct |
4 ms |
500 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
468 KB |
Output is correct |
2 |
Correct |
4 ms |
468 KB |
Output is correct |
3 |
Correct |
4 ms |
468 KB |
Output is correct |
4 |
Correct |
4 ms |
468 KB |
Output is correct |
5 |
Correct |
4 ms |
468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
56 ms |
2580 KB |
Output is correct |
2 |
Correct |
57 ms |
2724 KB |
Output is correct |
3 |
Correct |
34 ms |
2004 KB |
Output is correct |
4 |
Correct |
51 ms |
2696 KB |
Output is correct |
5 |
Correct |
28 ms |
1892 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
46 ms |
2664 KB |
Output is correct |
2 |
Correct |
44 ms |
2536 KB |
Output is correct |
3 |
Correct |
58 ms |
2872 KB |
Output is correct |
4 |
Correct |
53 ms |
2772 KB |
Output is correct |
5 |
Correct |
58 ms |
3040 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
58 ms |
3196 KB |
Output is correct |
2 |
Correct |
60 ms |
2908 KB |
Output is correct |
3 |
Correct |
55 ms |
2980 KB |
Output is correct |
4 |
Correct |
70 ms |
3336 KB |
Output is correct |
5 |
Correct |
52 ms |
3120 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
76 ms |
3352 KB |
Output is correct |
2 |
Correct |
77 ms |
3460 KB |
Output is correct |
3 |
Correct |
64 ms |
3412 KB |
Output is correct |
4 |
Correct |
70 ms |
3400 KB |
Output is correct |
5 |
Correct |
64 ms |
3436 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
79 ms |
3400 KB |
Output is correct |
2 |
Correct |
74 ms |
3460 KB |
Output is correct |
3 |
Correct |
63 ms |
3340 KB |
Output is correct |
4 |
Correct |
71 ms |
3404 KB |
Output is correct |
5 |
Correct |
62 ms |
3416 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
328 ms |
15980 KB |
Output is correct |
2 |
Correct |
367 ms |
15916 KB |
Output is correct |
3 |
Correct |
365 ms |
15972 KB |
Output is correct |
4 |
Correct |
352 ms |
15976 KB |
Output is correct |
5 |
Correct |
324 ms |
15988 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
374 ms |
15904 KB |
Output is correct |
2 |
Correct |
421 ms |
16028 KB |
Output is correct |
3 |
Correct |
325 ms |
16076 KB |
Output is correct |
4 |
Correct |
359 ms |
15880 KB |
Output is correct |
5 |
Correct |
344 ms |
16004 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
415 ms |
19032 KB |
Output is correct |
2 |
Correct |
460 ms |
19120 KB |
Output is correct |
3 |
Correct |
454 ms |
19184 KB |
Output is correct |
4 |
Correct |
476 ms |
19064 KB |
Output is correct |
5 |
Correct |
390 ms |
19148 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
453 ms |
19120 KB |
Output is correct |
2 |
Correct |
513 ms |
19120 KB |
Output is correct |
3 |
Correct |
377 ms |
19148 KB |
Output is correct |
4 |
Correct |
429 ms |
19152 KB |
Output is correct |
5 |
Correct |
386 ms |
19120 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
495 ms |
22248 KB |
Output is correct |
2 |
Correct |
540 ms |
22176 KB |
Output is correct |
3 |
Correct |
502 ms |
22240 KB |
Output is correct |
4 |
Correct |
504 ms |
22248 KB |
Output is correct |
5 |
Correct |
444 ms |
22304 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
520 ms |
22204 KB |
Output is correct |
2 |
Correct |
557 ms |
22260 KB |
Output is correct |
3 |
Correct |
452 ms |
22296 KB |
Output is correct |
4 |
Correct |
490 ms |
22152 KB |
Output is correct |
5 |
Correct |
449 ms |
22252 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
545 ms |
25380 KB |
Output is correct |
2 |
Correct |
590 ms |
25380 KB |
Output is correct |
3 |
Correct |
581 ms |
25376 KB |
Output is correct |
4 |
Correct |
571 ms |
25360 KB |
Output is correct |
5 |
Correct |
518 ms |
25324 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
589 ms |
25384 KB |
Output is correct |
2 |
Correct |
644 ms |
25276 KB |
Output is correct |
3 |
Correct |
513 ms |
25344 KB |
Output is correct |
4 |
Correct |
563 ms |
25360 KB |
Output is correct |
5 |
Correct |
538 ms |
25448 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
670 ms |
31544 KB |
Output is correct |
2 |
Correct |
743 ms |
31692 KB |
Output is correct |
3 |
Correct |
718 ms |
31592 KB |
Output is correct |
4 |
Correct |
694 ms |
31560 KB |
Output is correct |
5 |
Correct |
651 ms |
31628 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
736 ms |
31520 KB |
Output is correct |
2 |
Correct |
791 ms |
31672 KB |
Output is correct |
3 |
Correct |
659 ms |
31732 KB |
Output is correct |
4 |
Correct |
699 ms |
31628 KB |
Output is correct |
5 |
Correct |
652 ms |
31628 KB |
Output is correct |