#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false); cin.tie(0);
int n; double l; cin >> n >> l;
vector<pair<long long, long long>> a;
for (int i = 0; i < n; i++) {
long long x, y; cin >> x >> y;
a.push_back({x, y});
}
long double lo = 0, ri = 1e9;
while (fabs(lo - ri) > 1e-6) {
long double m = (lo + ri) / 2, cur = 0;
for (int i = 0; i < n; i++) {
long double d = sqrt(m * m - a[i].second * a[i].second);
if (a[i].first - d <= cur) cur = max(cur, a[i].first + d);
}
if (cur - l >= 1e-9) ri = m;
else lo = m;
}
cout << fixed << setprecision(12) << lo << "\n";
return 0;
};
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
320 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
320 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
4 ms |
328 KB |
Output is correct |
4 |
Correct |
3 ms |
456 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
9 ms |
456 KB |
Output is correct |
2 |
Correct |
3 ms |
596 KB |
Output is correct |
3 |
Correct |
3 ms |
468 KB |
Output is correct |
4 |
Correct |
6 ms |
596 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
460 KB |
Output is correct |
2 |
Correct |
2 ms |
604 KB |
Output is correct |
3 |
Correct |
4 ms |
468 KB |
Output is correct |
4 |
Correct |
7 ms |
592 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
468 KB |
Output is correct |
2 |
Correct |
3 ms |
548 KB |
Output is correct |
3 |
Correct |
3 ms |
468 KB |
Output is correct |
4 |
Correct |
7 ms |
596 KB |
Output is correct |
5 |
Correct |
5 ms |
468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
104 ms |
2804 KB |
Output is correct |
2 |
Correct |
33 ms |
2896 KB |
Output is correct |
3 |
Correct |
37 ms |
2088 KB |
Output is correct |
4 |
Correct |
90 ms |
3664 KB |
Output is correct |
5 |
Correct |
50 ms |
1876 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
93 ms |
2864 KB |
Output is correct |
2 |
Correct |
98 ms |
2792 KB |
Output is correct |
3 |
Correct |
92 ms |
2896 KB |
Output is correct |
4 |
Correct |
97 ms |
3660 KB |
Output is correct |
5 |
Correct |
110 ms |
3776 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
62 ms |
2896 KB |
Output is correct |
2 |
Correct |
47 ms |
2872 KB |
Output is correct |
3 |
Correct |
68 ms |
3348 KB |
Output is correct |
4 |
Correct |
266 ms |
3912 KB |
Output is correct |
5 |
Correct |
96 ms |
3408 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
56 ms |
2884 KB |
Output is correct |
2 |
Correct |
78 ms |
2880 KB |
Output is correct |
3 |
Correct |
66 ms |
3380 KB |
Output is correct |
4 |
Correct |
142 ms |
3956 KB |
Output is correct |
5 |
Correct |
115 ms |
3408 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
83 ms |
2860 KB |
Output is correct |
2 |
Correct |
53 ms |
2876 KB |
Output is correct |
3 |
Correct |
76 ms |
3268 KB |
Output is correct |
4 |
Correct |
151 ms |
3968 KB |
Output is correct |
5 |
Correct |
158 ms |
3508 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
281 ms |
8960 KB |
Output is correct |
2 |
Correct |
245 ms |
9024 KB |
Output is correct |
3 |
Correct |
260 ms |
15488 KB |
Output is correct |
4 |
Correct |
821 ms |
17888 KB |
Output is correct |
5 |
Correct |
663 ms |
15052 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
214 ms |
8944 KB |
Output is correct |
2 |
Correct |
581 ms |
14776 KB |
Output is correct |
3 |
Correct |
292 ms |
14000 KB |
Output is correct |
4 |
Correct |
733 ms |
17556 KB |
Output is correct |
5 |
Correct |
633 ms |
15480 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
251 ms |
17256 KB |
Output is correct |
2 |
Correct |
318 ms |
17096 KB |
Output is correct |
3 |
Correct |
259 ms |
24652 KB |
Output is correct |
4 |
Correct |
932 ms |
27424 KB |
Output is correct |
5 |
Correct |
723 ms |
24008 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
282 ms |
17060 KB |
Output is correct |
2 |
Correct |
717 ms |
23804 KB |
Output is correct |
3 |
Correct |
379 ms |
23072 KB |
Output is correct |
4 |
Correct |
890 ms |
27244 KB |
Output is correct |
5 |
Correct |
773 ms |
24616 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
290 ms |
17248 KB |
Output is correct |
2 |
Correct |
318 ms |
17040 KB |
Output is correct |
3 |
Correct |
337 ms |
24624 KB |
Output is correct |
4 |
Execution timed out |
1025 ms |
27128 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
407 ms |
17072 KB |
Output is correct |
2 |
Execution timed out |
1008 ms |
23904 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
320 ms |
17312 KB |
Output is correct |
2 |
Correct |
370 ms |
16828 KB |
Output is correct |
3 |
Correct |
358 ms |
24604 KB |
Output is correct |
4 |
Execution timed out |
1075 ms |
28568 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
392 ms |
16812 KB |
Output is correct |
2 |
Execution timed out |
1061 ms |
23968 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
413 ms |
16796 KB |
Output is correct |
2 |
Correct |
514 ms |
16856 KB |
Output is correct |
3 |
Correct |
462 ms |
30640 KB |
Output is correct |
4 |
Execution timed out |
1012 ms |
35240 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
392 ms |
16812 KB |
Output is correct |
2 |
Execution timed out |
1060 ms |
29320 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |