#include<bits/stdc++.h>
using namespace std;
using ll = long long ;
ll n, l;
ll x[1000005], y[1000005];
bool Can(double R) {
double D, x1, x2, mx = 0.0;
for (int j = 1; j <= n; j ++) {
D = R * R - y[j] * y[j];
D = sqrt(D);
x1 = x[j] - D;
x2 = x[j] + D;
if ( x1 > mx) return false;
mx = max(mx,x2);
}
if ( mx < l) return false;
return true;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
ll i;
double lo , hi, mid;
cin >> n >> l;
for (i = 1; i <= n; i ++) {
cin >> x[i] >> y[i];
}
lo = 0;
hi = 1.5e9;
while (hi - lo > 1e-3) {
mid = (lo + hi)/2;
if (!Can(mid)) lo = mid;
else hi = mid;
}
cout << fixed << setprecision(4) << lo << "\n";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2392 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Incorrect |
0 ms |
2396 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2396 KB |
Output is correct |
4 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
2396 KB |
Output is correct |
2 |
Correct |
2 ms |
2392 KB |
Output is correct |
3 |
Incorrect |
2 ms |
2396 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
23 ms |
7004 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
20 ms |
6748 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
20 ms |
6748 KB |
Output is correct |
2 |
Incorrect |
18 ms |
6748 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
20 ms |
6744 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
27 ms |
6716 KB |
Output is correct |
2 |
Incorrect |
20 ms |
6792 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
111 ms |
10972 KB |
Output is correct |
2 |
Correct |
98 ms |
10832 KB |
Output is correct |
3 |
Correct |
94 ms |
10632 KB |
Output is correct |
4 |
Incorrect |
152 ms |
10884 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
109 ms |
10880 KB |
Output is correct |
2 |
Incorrect |
181 ms |
10880 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
130 ms |
14928 KB |
Output is correct |
2 |
Incorrect |
119 ms |
14740 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
119 ms |
14932 KB |
Output is correct |
2 |
Incorrect |
207 ms |
14976 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
152 ms |
14932 KB |
Output is correct |
2 |
Incorrect |
130 ms |
14980 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
159 ms |
15236 KB |
Output is correct |
2 |
Incorrect |
234 ms |
14984 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
172 ms |
14932 KB |
Output is correct |
2 |
Incorrect |
188 ms |
14984 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
153 ms |
14932 KB |
Output is correct |
2 |
Incorrect |
264 ms |
14932 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
212 ms |
16008 KB |
Output is correct |
2 |
Incorrect |
204 ms |
15952 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
189 ms |
16088 KB |
Output is correct |
2 |
Incorrect |
313 ms |
15988 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |