#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-4;
pair<long long, long long> cor[1000001];
int main() {
int n;
double len;
cin >> n >> len;
for (int i = 0; i < n; i++)
cin >> cor[i].first >> cor[i].second;
double l = 0, r = 4e9 + 1, m;
while (r - l > eps) {
m = (l + r) / 2;
double cur_pos = 0;
for (int i = 0; i < n; i++) {
if (m < abs(cor[i].second) + eps) continue;
double dx = sqrt(m * m - cor[i].second * cor[i].second);
if (cor[i].first - dx < cur_pos + eps) cur_pos = max(cur_pos, cor[i].first + dx);
}
if (len < cur_pos + eps)
r = m;
else
l = m + eps;
}
cout << setprecision(3) << fixed << r << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
212 KB |
Output is correct |
4 |
Correct |
2 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
340 KB |
Output is correct |
2 |
Correct |
4 ms |
384 KB |
Output is correct |
3 |
Correct |
3 ms |
340 KB |
Output is correct |
4 |
Correct |
4 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
340 KB |
Output is correct |
2 |
Correct |
4 ms |
340 KB |
Output is correct |
3 |
Correct |
3 ms |
340 KB |
Output is correct |
4 |
Correct |
4 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
348 KB |
Output is correct |
2 |
Correct |
4 ms |
340 KB |
Output is correct |
3 |
Correct |
3 ms |
340 KB |
Output is correct |
4 |
Correct |
5 ms |
340 KB |
Output is correct |
5 |
Correct |
3 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
54 ms |
1404 KB |
Output is correct |
2 |
Correct |
58 ms |
1452 KB |
Output is correct |
3 |
Correct |
35 ms |
1132 KB |
Output is correct |
4 |
Correct |
57 ms |
1352 KB |
Output is correct |
5 |
Correct |
26 ms |
976 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
46 ms |
1424 KB |
Output is correct |
2 |
Correct |
48 ms |
1324 KB |
Output is correct |
3 |
Correct |
53 ms |
1544 KB |
Output is correct |
4 |
Correct |
62 ms |
1504 KB |
Output is correct |
5 |
Correct |
65 ms |
1592 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
47 ms |
1652 KB |
Output is correct |
2 |
Correct |
62 ms |
1532 KB |
Output is correct |
3 |
Correct |
61 ms |
1548 KB |
Output is correct |
4 |
Correct |
82 ms |
1752 KB |
Output is correct |
5 |
Correct |
57 ms |
1612 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
76 ms |
1840 KB |
Output is correct |
2 |
Correct |
84 ms |
1776 KB |
Output is correct |
3 |
Correct |
62 ms |
1776 KB |
Output is correct |
4 |
Correct |
85 ms |
1824 KB |
Output is correct |
5 |
Correct |
65 ms |
1848 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
79 ms |
1756 KB |
Output is correct |
2 |
Correct |
74 ms |
1852 KB |
Output is correct |
3 |
Correct |
63 ms |
1852 KB |
Output is correct |
4 |
Correct |
82 ms |
1860 KB |
Output is correct |
5 |
Correct |
69 ms |
1868 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
289 ms |
8108 KB |
Output is correct |
2 |
Correct |
381 ms |
8012 KB |
Output is correct |
3 |
Correct |
370 ms |
8088 KB |
Output is correct |
4 |
Correct |
408 ms |
8136 KB |
Output is correct |
5 |
Correct |
338 ms |
8000 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
403 ms |
8324 KB |
Output is correct |
2 |
Correct |
417 ms |
8116 KB |
Output is correct |
3 |
Correct |
316 ms |
8012 KB |
Output is correct |
4 |
Correct |
396 ms |
8064 KB |
Output is correct |
5 |
Correct |
354 ms |
8140 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
358 ms |
9680 KB |
Output is correct |
2 |
Correct |
466 ms |
9648 KB |
Output is correct |
3 |
Correct |
443 ms |
9680 KB |
Output is correct |
4 |
Correct |
505 ms |
9688 KB |
Output is correct |
5 |
Correct |
401 ms |
9764 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
472 ms |
9684 KB |
Output is correct |
2 |
Correct |
504 ms |
9712 KB |
Output is correct |
3 |
Correct |
376 ms |
9676 KB |
Output is correct |
4 |
Correct |
492 ms |
9776 KB |
Output is correct |
5 |
Correct |
414 ms |
9656 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
412 ms |
11244 KB |
Output is correct |
2 |
Correct |
534 ms |
11200 KB |
Output is correct |
3 |
Correct |
510 ms |
11256 KB |
Output is correct |
4 |
Correct |
589 ms |
11376 KB |
Output is correct |
5 |
Correct |
468 ms |
11348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
567 ms |
11244 KB |
Output is correct |
2 |
Correct |
576 ms |
11328 KB |
Output is correct |
3 |
Correct |
458 ms |
11316 KB |
Output is correct |
4 |
Correct |
587 ms |
11244 KB |
Output is correct |
5 |
Correct |
503 ms |
11232 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
476 ms |
12928 KB |
Output is correct |
2 |
Correct |
607 ms |
12916 KB |
Output is correct |
3 |
Correct |
608 ms |
12812 KB |
Output is correct |
4 |
Correct |
673 ms |
12840 KB |
Output is correct |
5 |
Correct |
557 ms |
13004 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
639 ms |
12812 KB |
Output is correct |
2 |
Correct |
644 ms |
12832 KB |
Output is correct |
3 |
Correct |
530 ms |
12728 KB |
Output is correct |
4 |
Correct |
657 ms |
12924 KB |
Output is correct |
5 |
Correct |
569 ms |
12728 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
594 ms |
15884 KB |
Output is correct |
2 |
Correct |
767 ms |
15936 KB |
Output is correct |
3 |
Correct |
735 ms |
15948 KB |
Output is correct |
4 |
Correct |
819 ms |
15928 KB |
Output is correct |
5 |
Correct |
672 ms |
16048 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
794 ms |
15900 KB |
Output is correct |
2 |
Correct |
791 ms |
15904 KB |
Output is correct |
3 |
Correct |
658 ms |
16020 KB |
Output is correct |
4 |
Correct |
810 ms |
16032 KB |
Output is correct |
5 |
Correct |
718 ms |
15936 KB |
Output is correct |