#include <bits/stdc++.h>
using i64 = long long;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n, L;
std::cin >> n >> L;
std::vector<int> x(n), y(n);
for (int i = 0; i < n; i++) {
std::cin >> x[i] >> y[i];
}
const double eps = 1E-4;
std::function<bool(double)> check = [&](double r) {
double f = 0;
for (int i = 0; i < n; i++) {
if (r * r >= (long double) y[i] * y[i]) {
double p = std::sqrt(r * r - (long double) y[i] * y[i]);
if (x[i] - p <= f) {
f = x[i] + p;
}
}
}
return f + eps >= L;
};
double low = 0, high = 2E9, ans = -1;
for (int i = 0; i < 100; i++) {
double mid = (low + high) / 2;
if (check(mid)) {
ans = mid;
high = mid;
} else {
low = mid;
}
}
std::cout << std::fixed << std::setprecision(4) << ans << "\n";
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
328 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
332 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Incorrect |
1 ms |
328 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
412 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
340 KB |
Output is correct |
2 |
Correct |
5 ms |
340 KB |
Output is correct |
3 |
Correct |
3 ms |
340 KB |
Output is correct |
4 |
Incorrect |
3 ms |
340 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
80 ms |
1720 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
29 ms |
1676 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
61 ms |
1696 KB |
Output is correct |
2 |
Correct |
87 ms |
2100 KB |
Output is correct |
3 |
Correct |
53 ms |
1996 KB |
Output is correct |
4 |
Incorrect |
37 ms |
3020 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
66 ms |
2632 KB |
Output is correct |
2 |
Correct |
66 ms |
2512 KB |
Output is correct |
3 |
Correct |
54 ms |
2252 KB |
Output is correct |
4 |
Incorrect |
40 ms |
3012 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
61 ms |
2616 KB |
Output is correct |
2 |
Correct |
74 ms |
2512 KB |
Output is correct |
3 |
Correct |
51 ms |
2124 KB |
Output is correct |
4 |
Incorrect |
36 ms |
3024 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
275 ms |
8528 KB |
Output is correct |
2 |
Correct |
325 ms |
12036 KB |
Output is correct |
3 |
Correct |
293 ms |
11524 KB |
Output is correct |
4 |
Incorrect |
192 ms |
13692 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
299 ms |
12556 KB |
Output is correct |
2 |
Incorrect |
566 ms |
10752 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
362 ms |
10316 KB |
Output is correct |
2 |
Correct |
361 ms |
14304 KB |
Output is correct |
3 |
Correct |
388 ms |
13700 KB |
Output is correct |
4 |
Incorrect |
221 ms |
16912 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
382 ms |
14888 KB |
Output is correct |
2 |
Incorrect |
694 ms |
12940 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
420 ms |
11864 KB |
Output is correct |
2 |
Correct |
417 ms |
16648 KB |
Output is correct |
3 |
Correct |
407 ms |
15972 KB |
Output is correct |
4 |
Incorrect |
283 ms |
19244 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
416 ms |
17428 KB |
Output is correct |
2 |
Incorrect |
793 ms |
15052 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
452 ms |
13524 KB |
Output is correct |
2 |
Correct |
471 ms |
18984 KB |
Output is correct |
3 |
Correct |
509 ms |
18216 KB |
Output is correct |
4 |
Incorrect |
271 ms |
22252 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
477 ms |
19900 KB |
Output is correct |
2 |
Incorrect |
876 ms |
17164 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
594 ms |
16848 KB |
Output is correct |
2 |
Correct |
594 ms |
23764 KB |
Output is correct |
3 |
Correct |
570 ms |
22988 KB |
Output is correct |
4 |
Incorrect |
410 ms |
27340 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
656 ms |
24680 KB |
Output is correct |
2 |
Incorrect |
964 ms |
21332 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |