#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 < 150 ; ++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 |
380 KB |
Output is correct |
# |
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 |
9 ms |
376 KB |
Output is correct |
2 |
Correct |
7 ms |
376 KB |
Output is correct |
3 |
Correct |
7 ms |
376 KB |
Output is correct |
4 |
Correct |
7 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
15 ms |
376 KB |
Output is correct |
2 |
Correct |
12 ms |
504 KB |
Output is correct |
3 |
Correct |
12 ms |
404 KB |
Output is correct |
4 |
Correct |
16 ms |
504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
16 ms |
376 KB |
Output is correct |
2 |
Correct |
12 ms |
376 KB |
Output is correct |
3 |
Correct |
12 ms |
476 KB |
Output is correct |
4 |
Correct |
16 ms |
504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
376 KB |
Output is correct |
2 |
Correct |
12 ms |
504 KB |
Output is correct |
3 |
Correct |
12 ms |
376 KB |
Output is correct |
4 |
Correct |
17 ms |
504 KB |
Output is correct |
5 |
Correct |
15 ms |
504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
209 ms |
1528 KB |
Output is correct |
2 |
Correct |
153 ms |
1528 KB |
Output is correct |
3 |
Correct |
114 ms |
1144 KB |
Output is correct |
4 |
Correct |
221 ms |
1656 KB |
Output is correct |
5 |
Correct |
133 ms |
1060 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
211 ms |
1528 KB |
Output is correct |
2 |
Correct |
198 ms |
1528 KB |
Output is correct |
3 |
Correct |
229 ms |
1656 KB |
Output is correct |
4 |
Correct |
231 ms |
1656 KB |
Output is correct |
5 |
Correct |
259 ms |
1784 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
159 ms |
1784 KB |
Output is correct |
2 |
Correct |
164 ms |
1656 KB |
Output is correct |
3 |
Correct |
181 ms |
1804 KB |
Output is correct |
4 |
Correct |
305 ms |
1956 KB |
Output is correct |
5 |
Correct |
244 ms |
1784 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
201 ms |
2048 KB |
Output is correct |
2 |
Correct |
213 ms |
2004 KB |
Output is correct |
3 |
Correct |
215 ms |
1980 KB |
Output is correct |
4 |
Correct |
307 ms |
1912 KB |
Output is correct |
5 |
Correct |
282 ms |
2040 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
200 ms |
1972 KB |
Output is correct |
2 |
Correct |
200 ms |
2104 KB |
Output is correct |
3 |
Correct |
211 ms |
2040 KB |
Output is correct |
4 |
Correct |
308 ms |
1980 KB |
Output is correct |
5 |
Correct |
282 ms |
1912 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
922 ms |
8272 KB |
Output is correct |
2 |
Execution timed out |
1004 ms |
15968 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1006 ms |
8236 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1080 ms |
9812 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1072 ms |
9800 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1077 ms |
11384 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1058 ms |
11312 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1073 ms |
12980 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1077 ms |
12936 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1082 ms |
15944 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1070 ms |
15984 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |