#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 10;
int x[MAX], y[MAX];
int n, l;
bool check(double radius) {
double now = 0.0;
for (int i = 0; i < n; ++i) {
if (radius * radius < 1.0 * y[i] * y[i])
return false;
double dx = sqrt(radius * radius - 1.0 * y[i] * y[i]);
double a = x[i] - dx;
double b = x[i] + dx;
if (a > now)
return false;
now = max(now, b);
}
return now >= l;
}
int main() {
cin >> n >> l;
for (int i = 0; i < n; ++i) {
cin >> x[i] >> y[i];
}
double low = 0.0, high = 1e9, ans = 1e9;
for (int i = 0; i < 100; ++i) {
double mid = (low + high) / 2.0;
if (check(mid)) {
ans = mid;
high = mid;
} else {
low = mid;
}
}
cout << fixed << setprecision(6) << ans << "\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |