#include <bits/stdc++.h>
using namespace std ;
const int MAX = 1e6 + 10 ;
double x[MAX] , y[MAX] ;
int n ;
double l;
bool check(double radius)
{
double now = 0.00 ;
for(int i = 0 ; i < n ; ++i)
{
double a = sqrt(radius * radius - ((-y[i]) * (-y[i]))) + x[i] ;
double b = -sqrt(radius * radius - ((-y[i]) * (-y[i]))) + x[i] ;
if(a > b)
swap(a , b) ;
if(a <= now)
now = max(now , b) ;
}
return (now >= l) ;
}
int main()
{
ios_base::sync_with_stdio(0) ;
cin.tie(0) ;
cin>>n>>l ;
for(int i = 0 ; i < n ; ++i)
cin>>x[i]>>y[i] ;
double low = 0.000 , high = 1e12 ;
double ans = high ;
for(int i = 0 ; i < 300 ; ++i)
{
double mid = (low + high) / 2.00 ;
if(check(mid))
ans = mid , high = mid ;
else
low = mid ;
}
return cout<<fixed<<setprecision(6)<<ans<<"\n" , 0 ;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
376 KB |
Output is correct |
2 |
Correct |
3 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
420 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
16 ms |
376 KB |
Output is correct |
2 |
Correct |
11 ms |
376 KB |
Output is correct |
3 |
Correct |
12 ms |
376 KB |
Output is correct |
4 |
Correct |
10 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
504 KB |
Output is correct |
2 |
Correct |
18 ms |
504 KB |
Output is correct |
3 |
Correct |
20 ms |
504 KB |
Output is correct |
4 |
Correct |
28 ms |
504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
476 KB |
Output is correct |
2 |
Correct |
18 ms |
504 KB |
Output is correct |
3 |
Correct |
20 ms |
376 KB |
Output is correct |
4 |
Correct |
28 ms |
468 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
504 KB |
Output is correct |
2 |
Correct |
18 ms |
504 KB |
Output is correct |
3 |
Correct |
20 ms |
504 KB |
Output is correct |
4 |
Correct |
28 ms |
468 KB |
Output is correct |
5 |
Correct |
27 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
397 ms |
1600 KB |
Output is correct |
2 |
Correct |
255 ms |
1528 KB |
Output is correct |
3 |
Correct |
200 ms |
1144 KB |
Output is correct |
4 |
Correct |
402 ms |
1524 KB |
Output is correct |
5 |
Correct |
253 ms |
1180 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
398 ms |
1620 KB |
Output is correct |
2 |
Correct |
365 ms |
1496 KB |
Output is correct |
3 |
Correct |
429 ms |
1668 KB |
Output is correct |
4 |
Correct |
420 ms |
1656 KB |
Output is correct |
5 |
Correct |
466 ms |
1812 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
275 ms |
1784 KB |
Output is correct |
2 |
Correct |
272 ms |
1676 KB |
Output is correct |
3 |
Correct |
314 ms |
1788 KB |
Output is correct |
4 |
Correct |
542 ms |
2108 KB |
Output is correct |
5 |
Correct |
456 ms |
1784 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
334 ms |
2040 KB |
Output is correct |
2 |
Correct |
332 ms |
1912 KB |
Output is correct |
3 |
Correct |
371 ms |
2040 KB |
Output is correct |
4 |
Correct |
545 ms |
1912 KB |
Output is correct |
5 |
Correct |
528 ms |
2044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
340 ms |
1972 KB |
Output is correct |
2 |
Correct |
359 ms |
2056 KB |
Output is correct |
3 |
Correct |
372 ms |
1912 KB |
Output is correct |
4 |
Correct |
545 ms |
2072 KB |
Output is correct |
5 |
Correct |
531 ms |
2044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1073 ms |
11512 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1064 ms |
14752 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1063 ms |
13972 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1079 ms |
17912 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1081 ms |
16360 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1076 ms |
21116 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1071 ms |
18824 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1070 ms |
24448 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1058 ms |
23844 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1063 ms |
30764 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |