#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using tiiii = tuple<int, int, ll, ll>;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
int n, L; cin >> n >> L;
vector < int > x(n), y(n);
for (int i = 0; i < n; i++)
cin >> x[i] >> y[i];
auto Good = [&](double dist) {
double r = 0;
for (int i = 0; i < n; i++) {
if (y[i] > dist)
continue;
double left = x[i] - sqrtl(dist * dist - y[i] * y[i]);
double right = x[i] + sqrtl(dist * dist - y[i] * y[i]);
if (r < left)
return false;
r = max(r, right);
}
return r > L;
};
double l = 0, m, r = 2e+9;
for (int i = 0; i < 100; i++) {
m = (l + r) / 2;
if (Good(m))
r = m;
else
l = m;
}
cout << setprecision(16) << fixed << r << "\n";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
8 ms |
544 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
348 KB |
Output is correct |
2 |
Correct |
3 ms |
472 KB |
Output is correct |
3 |
Incorrect |
2 ms |
348 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
56 ms |
1804 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
96 ms |
1368 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
54 ms |
1628 KB |
Output is correct |
2 |
Incorrect |
42 ms |
1628 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
28 ms |
2140 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
59 ms |
2248 KB |
Output is correct |
2 |
Incorrect |
52 ms |
2140 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
304 ms |
6668 KB |
Output is correct |
2 |
Correct |
251 ms |
8524 KB |
Output is correct |
3 |
Correct |
259 ms |
8020 KB |
Output is correct |
4 |
Incorrect |
966 ms |
9516 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
237 ms |
8868 KB |
Output is correct |
2 |
Incorrect |
450 ms |
7940 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
375 ms |
8036 KB |
Output is correct |
2 |
Incorrect |
186 ms |
10004 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
150 ms |
10056 KB |
Output is correct |
2 |
Incorrect |
521 ms |
9236 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
433 ms |
9252 KB |
Output is correct |
2 |
Incorrect |
344 ms |
11356 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
342 ms |
11860 KB |
Output is correct |
2 |
Incorrect |
630 ms |
10584 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
492 ms |
10560 KB |
Output is correct |
2 |
Incorrect |
385 ms |
13108 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
371 ms |
13628 KB |
Output is correct |
2 |
Incorrect |
620 ms |
12368 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
612 ms |
12880 KB |
Output is correct |
2 |
Incorrect |
531 ms |
16212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
445 ms |
16720 KB |
Output is correct |
2 |
Incorrect |
565 ms |
15188 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |