#include "bits/stdc++.h"
using namespace std;
const int INF = 1e9 + 7;
int32_t main() {
cin.tie(0)->sync_with_stdio(0);
int n, L; cin >> n >> L;
vector<pair<int, int>> a(n);
for (auto &x: a) cin >> x.first >> x.second;
auto good = [&](double R) {
vector<pair<double, double>> b;
for (auto i: a) {
long long u, v; tie(u, v) = i;
#define sqr(x) (x) * (x)
double delta = sqrt(sqr(R) - sqr(v));
double x1 = -delta + u, x2 = delta + u;
b.emplace_back(x1, x2);
// cout << fixed << setprecision(10) << x1 << ' ' << x2 << '\n';
}
sort(b.begin(), b.end());
double l = 0;
for (auto i: b) {
if (i.first <= l) l = max(l, i.second);
}
return l >= L;
};
double l = -1, r = 1e9 + 1;
for (int i = 1, ITER = 80; i <= ITER; ++i) {
double m = l + (r - l) / 2;
if (good(m)) r = m;
else l = m;
}
cout << fixed << setprecision(20) << r;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
8 ms |
460 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
18 ms |
612 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
17 ms |
620 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
636 KB |
Output is correct |
2 |
Correct |
13 ms |
644 KB |
Output is correct |
3 |
Correct |
16 ms |
612 KB |
Output is correct |
4 |
Incorrect |
20 ms |
656 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
442 ms |
4472 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
331 ms |
4560 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
254 ms |
4824 KB |
Output is correct |
2 |
Correct |
420 ms |
4656 KB |
Output is correct |
3 |
Correct |
384 ms |
4768 KB |
Output is correct |
4 |
Incorrect |
456 ms |
5284 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
394 ms |
5212 KB |
Output is correct |
2 |
Correct |
568 ms |
5188 KB |
Output is correct |
3 |
Correct |
485 ms |
5096 KB |
Output is correct |
4 |
Incorrect |
560 ms |
5248 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
275 ms |
5188 KB |
Output is correct |
2 |
Correct |
528 ms |
5160 KB |
Output is correct |
3 |
Correct |
474 ms |
5072 KB |
Output is correct |
4 |
Incorrect |
482 ms |
5176 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1100 ms |
20836 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1016 ms |
20832 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1104 ms |
31292 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1022 ms |
31244 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1045 ms |
33780 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1058 ms |
33628 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1063 ms |
36100 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1034 ms |
35960 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1057 ms |
40764 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1077 ms |
40372 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |