/**
* author: FromDihPout
* created: 2022-04-18
**/
#include <bits/stdc++.h>
using namespace std;
const double EPSILON = 1e-3;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, l;
cin >> n >> l;
vector<array<double, 2>> p(n);
for (int i = 0; i < n; i++) {
cin >> p[i][0] >> p[i][1];
}
auto check = [&](double r) {
double end = 0;
for (int i = 0; i < n; i++) {
if (p[i][1] >= r) continue;
double length = sqrt((r * r) - (p[i][1] * p[i][1]));
double left = p[i][0] - length, right = p[i][0] + length;
if (left <= end) {
end = max(end, right);
}
}
return end >= l;
};
double lo = 0, hi = 1e10;
while (hi - lo > EPSILON) {
double mid = (lo + hi) / 2;
if (check(mid)) {
hi = mid;
} else {
lo = mid;
}
}
cout << fixed << setprecision(4) << lo << '\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 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 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
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 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
2 ms |
328 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
3 ms |
392 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
332 KB |
Output is correct |
2 |
Correct |
4 ms |
468 KB |
Output is correct |
3 |
Correct |
3 ms |
332 KB |
Output is correct |
4 |
Correct |
4 ms |
468 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
340 KB |
Output is correct |
2 |
Correct |
4 ms |
468 KB |
Output is correct |
3 |
Correct |
4 ms |
340 KB |
Output is correct |
4 |
Correct |
4 ms |
468 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
340 KB |
Output is correct |
2 |
Correct |
4 ms |
468 KB |
Output is correct |
3 |
Correct |
3 ms |
328 KB |
Output is correct |
4 |
Correct |
4 ms |
480 KB |
Output is correct |
5 |
Correct |
4 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
60 ms |
1720 KB |
Output is correct |
2 |
Correct |
65 ms |
1964 KB |
Output is correct |
3 |
Correct |
30 ms |
1488 KB |
Output is correct |
4 |
Correct |
60 ms |
2064 KB |
Output is correct |
5 |
Correct |
25 ms |
1364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
1708 KB |
Output is correct |
2 |
Correct |
61 ms |
1916 KB |
Output is correct |
3 |
Correct |
66 ms |
1988 KB |
Output is correct |
4 |
Correct |
63 ms |
2128 KB |
Output is correct |
5 |
Correct |
76 ms |
2388 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
57 ms |
1896 KB |
Output is correct |
2 |
Correct |
58 ms |
1996 KB |
Output is correct |
3 |
Correct |
45 ms |
2252 KB |
Output is correct |
4 |
Correct |
92 ms |
2476 KB |
Output is correct |
5 |
Correct |
55 ms |
2224 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
74 ms |
2140 KB |
Output is correct |
2 |
Correct |
69 ms |
2356 KB |
Output is correct |
3 |
Correct |
53 ms |
2512 KB |
Output is correct |
4 |
Correct |
91 ms |
2508 KB |
Output is correct |
5 |
Correct |
73 ms |
2400 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
81 ms |
2036 KB |
Output is correct |
2 |
Correct |
66 ms |
2308 KB |
Output is correct |
3 |
Correct |
67 ms |
2512 KB |
Output is correct |
4 |
Correct |
100 ms |
2484 KB |
Output is correct |
5 |
Correct |
77 ms |
2364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
287 ms |
8540 KB |
Output is correct |
2 |
Correct |
306 ms |
15804 KB |
Output is correct |
3 |
Correct |
356 ms |
15296 KB |
Output is correct |
4 |
Correct |
495 ms |
17600 KB |
Output is correct |
5 |
Correct |
370 ms |
15040 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
349 ms |
8624 KB |
Output is correct |
2 |
Correct |
329 ms |
14668 KB |
Output is correct |
3 |
Correct |
273 ms |
13760 KB |
Output is correct |
4 |
Correct |
457 ms |
17344 KB |
Output is correct |
5 |
Correct |
398 ms |
15424 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
349 ms |
10196 KB |
Output is correct |
2 |
Correct |
364 ms |
18972 KB |
Output is correct |
3 |
Correct |
401 ms |
18260 KB |
Output is correct |
4 |
Correct |
576 ms |
21468 KB |
Output is correct |
5 |
Correct |
462 ms |
17628 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
415 ms |
10032 KB |
Output is correct |
2 |
Correct |
413 ms |
17500 KB |
Output is correct |
3 |
Correct |
330 ms |
16468 KB |
Output is correct |
4 |
Correct |
584 ms |
21332 KB |
Output is correct |
5 |
Correct |
474 ms |
18404 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
412 ms |
11656 KB |
Output is correct |
2 |
Correct |
452 ms |
22008 KB |
Output is correct |
3 |
Correct |
446 ms |
21376 KB |
Output is correct |
4 |
Correct |
659 ms |
24692 KB |
Output is correct |
5 |
Correct |
521 ms |
20228 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
453 ms |
11952 KB |
Output is correct |
2 |
Correct |
471 ms |
20472 KB |
Output is correct |
3 |
Correct |
383 ms |
19576 KB |
Output is correct |
4 |
Correct |
660 ms |
24568 KB |
Output is correct |
5 |
Correct |
557 ms |
21364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
437 ms |
14052 KB |
Output is correct |
2 |
Correct |
595 ms |
25112 KB |
Output is correct |
3 |
Correct |
490 ms |
24340 KB |
Output is correct |
4 |
Correct |
743 ms |
28448 KB |
Output is correct |
5 |
Correct |
654 ms |
23956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
549 ms |
14668 KB |
Output is correct |
2 |
Correct |
515 ms |
23312 KB |
Output is correct |
3 |
Correct |
463 ms |
22308 KB |
Output is correct |
4 |
Correct |
772 ms |
28180 KB |
Output is correct |
5 |
Correct |
632 ms |
24368 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
508 ms |
19272 KB |
Output is correct |
2 |
Correct |
641 ms |
31448 KB |
Output is correct |
3 |
Correct |
645 ms |
30424 KB |
Output is correct |
4 |
Execution timed out |
1004 ms |
35016 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
664 ms |
16716 KB |
Output is correct |
2 |
Correct |
670 ms |
29260 KB |
Output is correct |
3 |
Correct |
582 ms |
28244 KB |
Output is correct |
4 |
Correct |
950 ms |
35284 KB |
Output is correct |
5 |
Correct |
818 ms |
30668 KB |
Output is correct |