#include<bits/stdc++.h>
using namespace std ;
const int maxn = 2e6 + 5 ;
const double inf = 2e9 + 5 ;
double n, l, x[maxn], y[maxn] ;
bool check(double r){
double f = 0 ;
for(int i = 1 ; i <= n ; i++){
if(r < y[i]) continue ;
double dx = sqrt(((r*r) - (y[i]*y[i]))) ;
double ini = x[i] - dx, fim = x[i] + dx ;
if(ini <= f) f = max(f, fim) ;
}
return (f >= l) ;
}
int main(){
cin >> n >> l ;
for(int i = 1 ; i <= n ; i++) cin >> x[i] >> y[i] ;
double ini = 0, fim = inf, mid ;
int ct = 45 ;
while(ct--){
mid = (ini + fim)/2 ;
if(check(mid)) fim = mid ;
else ini = mid ;
}
cout << fixed << setprecision(6) << fim << "\n" ;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 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 |
4 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
340 KB |
Output is correct |
2 |
Correct |
5 ms |
340 KB |
Output is correct |
3 |
Correct |
4 ms |
324 KB |
Output is correct |
4 |
Correct |
6 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
380 KB |
Output is correct |
2 |
Correct |
6 ms |
340 KB |
Output is correct |
3 |
Correct |
5 ms |
340 KB |
Output is correct |
4 |
Correct |
8 ms |
396 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
384 KB |
Output is correct |
2 |
Correct |
6 ms |
340 KB |
Output is correct |
3 |
Correct |
4 ms |
340 KB |
Output is correct |
4 |
Correct |
7 ms |
340 KB |
Output is correct |
5 |
Correct |
5 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
74 ms |
1432 KB |
Output is correct |
2 |
Correct |
84 ms |
1492 KB |
Output is correct |
3 |
Correct |
50 ms |
1088 KB |
Output is correct |
4 |
Correct |
100 ms |
1456 KB |
Output is correct |
5 |
Correct |
42 ms |
1044 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
73 ms |
1484 KB |
Output is correct |
2 |
Correct |
83 ms |
1360 KB |
Output is correct |
3 |
Correct |
95 ms |
1572 KB |
Output is correct |
4 |
Correct |
102 ms |
1532 KB |
Output is correct |
5 |
Correct |
130 ms |
1608 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
69 ms |
1672 KB |
Output is correct |
2 |
Correct |
94 ms |
1524 KB |
Output is correct |
3 |
Correct |
81 ms |
1612 KB |
Output is correct |
4 |
Correct |
154 ms |
1836 KB |
Output is correct |
5 |
Correct |
93 ms |
1652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
110 ms |
1848 KB |
Output is correct |
2 |
Correct |
116 ms |
1860 KB |
Output is correct |
3 |
Correct |
104 ms |
1744 KB |
Output is correct |
4 |
Correct |
156 ms |
1860 KB |
Output is correct |
5 |
Correct |
119 ms |
1860 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
117 ms |
1844 KB |
Output is correct |
2 |
Correct |
107 ms |
1816 KB |
Output is correct |
3 |
Correct |
89 ms |
1860 KB |
Output is correct |
4 |
Correct |
157 ms |
1744 KB |
Output is correct |
5 |
Correct |
119 ms |
1780 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
420 ms |
8084 KB |
Output is correct |
2 |
Correct |
575 ms |
8088 KB |
Output is correct |
3 |
Correct |
541 ms |
8124 KB |
Output is correct |
4 |
Correct |
787 ms |
8116 KB |
Output is correct |
5 |
Correct |
610 ms |
8160 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
609 ms |
8060 KB |
Output is correct |
2 |
Correct |
569 ms |
8236 KB |
Output is correct |
3 |
Correct |
478 ms |
8036 KB |
Output is correct |
4 |
Correct |
750 ms |
8128 KB |
Output is correct |
5 |
Correct |
658 ms |
8172 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
535 ms |
9688 KB |
Output is correct |
2 |
Correct |
701 ms |
9664 KB |
Output is correct |
3 |
Correct |
653 ms |
9596 KB |
Output is correct |
4 |
Correct |
947 ms |
9744 KB |
Output is correct |
5 |
Correct |
730 ms |
9760 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
702 ms |
9948 KB |
Output is correct |
2 |
Correct |
659 ms |
9688 KB |
Output is correct |
3 |
Correct |
571 ms |
9688 KB |
Output is correct |
4 |
Correct |
908 ms |
9580 KB |
Output is correct |
5 |
Correct |
800 ms |
9692 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
593 ms |
11328 KB |
Output is correct |
2 |
Correct |
783 ms |
11292 KB |
Output is correct |
3 |
Correct |
756 ms |
11196 KB |
Output is correct |
4 |
Execution timed out |
1047 ms |
11316 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
833 ms |
11368 KB |
Output is correct |
2 |
Correct |
776 ms |
11416 KB |
Output is correct |
3 |
Correct |
681 ms |
11260 KB |
Output is correct |
4 |
Execution timed out |
1073 ms |
11328 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
677 ms |
12796 KB |
Output is correct |
2 |
Correct |
911 ms |
12864 KB |
Output is correct |
3 |
Correct |
890 ms |
12816 KB |
Output is correct |
4 |
Execution timed out |
1067 ms |
12800 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
953 ms |
13032 KB |
Output is correct |
2 |
Correct |
887 ms |
12824 KB |
Output is correct |
3 |
Correct |
770 ms |
12924 KB |
Output is correct |
4 |
Execution timed out |
1082 ms |
12900 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
874 ms |
15952 KB |
Output is correct |
2 |
Execution timed out |
1089 ms |
15852 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1095 ms |
15916 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |