#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
pair<long long, long long> p[1000000];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, len;
cin >> n >> len;
for (int i = 0; i < n; i++) cin >> p[i].x >> p[i].y;
double l = 1, r = 1.5e9;
while (r - l > 1e-3) {
double mid = (l + r) / 2, curr = 0;
for (int i = 0; i < n; i++) {
double delta = sqrt(mid * mid - p[i].y * p[i].y);
double a = p[i].x - delta, b = p[i].x + delta;
if (a <= curr) curr = max(curr, b);
}
if (curr >= len) r = mid;
else l = mid;
}
cout << fixed << setprecision(4) << l;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
324 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
316 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
324 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
332 KB |
Output is correct |
2 |
Correct |
2 ms |
460 KB |
Output is correct |
3 |
Correct |
2 ms |
332 KB |
Output is correct |
4 |
Correct |
2 ms |
460 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
332 KB |
Output is correct |
2 |
Correct |
2 ms |
460 KB |
Output is correct |
3 |
Correct |
2 ms |
332 KB |
Output is correct |
4 |
Correct |
2 ms |
460 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
332 KB |
Output is correct |
2 |
Correct |
2 ms |
460 KB |
Output is correct |
3 |
Correct |
2 ms |
332 KB |
Output is correct |
4 |
Correct |
3 ms |
460 KB |
Output is correct |
5 |
Correct |
2 ms |
332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
30 ms |
1868 KB |
Output is correct |
2 |
Correct |
22 ms |
1996 KB |
Output is correct |
3 |
Correct |
17 ms |
1708 KB |
Output is correct |
4 |
Correct |
26 ms |
2380 KB |
Output is correct |
5 |
Correct |
13 ms |
1484 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
30 ms |
2024 KB |
Output is correct |
2 |
Correct |
24 ms |
1908 KB |
Output is correct |
3 |
Correct |
26 ms |
2076 KB |
Output is correct |
4 |
Correct |
31 ms |
2680 KB |
Output is correct |
5 |
Correct |
29 ms |
3144 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
20 ms |
2252 KB |
Output is correct |
2 |
Correct |
23 ms |
2036 KB |
Output is correct |
3 |
Correct |
22 ms |
2528 KB |
Output is correct |
4 |
Correct |
37 ms |
2636 KB |
Output is correct |
5 |
Correct |
27 ms |
2504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
35 ms |
2304 KB |
Output is correct |
2 |
Correct |
31 ms |
2380 KB |
Output is correct |
3 |
Correct |
26 ms |
2772 KB |
Output is correct |
4 |
Correct |
37 ms |
2628 KB |
Output is correct |
5 |
Correct |
34 ms |
3116 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
29 ms |
2384 KB |
Output is correct |
2 |
Correct |
30 ms |
2376 KB |
Output is correct |
3 |
Correct |
28 ms |
2736 KB |
Output is correct |
4 |
Correct |
40 ms |
2636 KB |
Output is correct |
5 |
Correct |
38 ms |
3084 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
128 ms |
8528 KB |
Output is correct |
2 |
Correct |
143 ms |
8628 KB |
Output is correct |
3 |
Correct |
136 ms |
9008 KB |
Output is correct |
4 |
Correct |
181 ms |
8952 KB |
Output is correct |
5 |
Correct |
161 ms |
15044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
141 ms |
9140 KB |
Output is correct |
2 |
Correct |
210 ms |
8960 KB |
Output is correct |
3 |
Correct |
136 ms |
9128 KB |
Output is correct |
4 |
Correct |
174 ms |
9020 KB |
Output is correct |
5 |
Correct |
163 ms |
15300 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
147 ms |
10160 KB |
Output is correct |
2 |
Correct |
177 ms |
10332 KB |
Output is correct |
3 |
Correct |
165 ms |
10480 KB |
Output is correct |
4 |
Correct |
220 ms |
11076 KB |
Output is correct |
5 |
Correct |
189 ms |
17732 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
179 ms |
10744 KB |
Output is correct |
2 |
Correct |
247 ms |
10692 KB |
Output is correct |
3 |
Correct |
155 ms |
10564 KB |
Output is correct |
4 |
Correct |
221 ms |
10864 KB |
Output is correct |
5 |
Correct |
199 ms |
18372 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
162 ms |
11716 KB |
Output is correct |
2 |
Correct |
199 ms |
11812 KB |
Output is correct |
3 |
Correct |
189 ms |
12100 KB |
Output is correct |
4 |
Correct |
250 ms |
12596 KB |
Output is correct |
5 |
Correct |
229 ms |
20304 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
227 ms |
12264 KB |
Output is correct |
2 |
Correct |
276 ms |
12148 KB |
Output is correct |
3 |
Correct |
181 ms |
12160 KB |
Output is correct |
4 |
Correct |
253 ms |
12652 KB |
Output is correct |
5 |
Correct |
230 ms |
21328 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
182 ms |
13432 KB |
Output is correct |
2 |
Correct |
234 ms |
13836 KB |
Output is correct |
3 |
Correct |
216 ms |
13980 KB |
Output is correct |
4 |
Correct |
289 ms |
14024 KB |
Output is correct |
5 |
Correct |
256 ms |
23920 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
226 ms |
13752 KB |
Output is correct |
2 |
Correct |
319 ms |
13740 KB |
Output is correct |
3 |
Correct |
215 ms |
13592 KB |
Output is correct |
4 |
Correct |
300 ms |
14020 KB |
Output is correct |
5 |
Correct |
270 ms |
24300 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
235 ms |
16700 KB |
Output is correct |
2 |
Correct |
286 ms |
16888 KB |
Output is correct |
3 |
Correct |
269 ms |
17160 KB |
Output is correct |
4 |
Correct |
360 ms |
16324 KB |
Output is correct |
5 |
Correct |
314 ms |
28004 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
284 ms |
16892 KB |
Output is correct |
2 |
Correct |
387 ms |
16876 KB |
Output is correct |
3 |
Correct |
278 ms |
16944 KB |
Output is correct |
4 |
Correct |
363 ms |
16360 KB |
Output is correct |
5 |
Correct |
338 ms |
27752 KB |
Output is correct |