#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;
}
# |
결과 |
실행 시간 |
메모리 |
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 |
0 ms |
328 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
328 KB |
Output is correct |
2 |
Correct |
1 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 |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
468 KB |
Output is correct |
3 |
Correct |
2 ms |
344 KB |
Output is correct |
4 |
Correct |
3 ms |
412 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
468 KB |
Output is correct |
3 |
Correct |
2 ms |
344 KB |
Output is correct |
4 |
Correct |
2 ms |
468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
468 KB |
Output is correct |
3 |
Correct |
3 ms |
444 KB |
Output is correct |
4 |
Correct |
2 ms |
468 KB |
Output is correct |
5 |
Correct |
2 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
27 ms |
2276 KB |
Output is correct |
2 |
Correct |
21 ms |
2540 KB |
Output is correct |
3 |
Correct |
14 ms |
1732 KB |
Output is correct |
4 |
Correct |
26 ms |
2612 KB |
Output is correct |
5 |
Correct |
13 ms |
1492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
2260 KB |
Output is correct |
2 |
Correct |
21 ms |
2132 KB |
Output is correct |
3 |
Correct |
25 ms |
2596 KB |
Output is correct |
4 |
Correct |
27 ms |
2696 KB |
Output is correct |
5 |
Correct |
33 ms |
3044 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
20 ms |
2268 KB |
Output is correct |
2 |
Correct |
22 ms |
2644 KB |
Output is correct |
3 |
Correct |
25 ms |
2600 KB |
Output is correct |
4 |
Correct |
37 ms |
3788 KB |
Output is correct |
5 |
Correct |
26 ms |
2564 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
29 ms |
3404 KB |
Output is correct |
2 |
Correct |
28 ms |
3276 KB |
Output is correct |
3 |
Correct |
26 ms |
2900 KB |
Output is correct |
4 |
Correct |
38 ms |
3768 KB |
Output is correct |
5 |
Correct |
30 ms |
3216 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
28 ms |
3276 KB |
Output is correct |
2 |
Correct |
29 ms |
3276 KB |
Output is correct |
3 |
Correct |
27 ms |
2884 KB |
Output is correct |
4 |
Correct |
37 ms |
3764 KB |
Output is correct |
5 |
Correct |
31 ms |
3144 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
120 ms |
12356 KB |
Output is correct |
2 |
Correct |
144 ms |
15868 KB |
Output is correct |
3 |
Correct |
138 ms |
15404 KB |
Output is correct |
4 |
Correct |
188 ms |
17716 KB |
Output is correct |
5 |
Correct |
165 ms |
14968 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
156 ms |
16312 KB |
Output is correct |
2 |
Correct |
211 ms |
14752 KB |
Output is correct |
3 |
Correct |
135 ms |
13832 KB |
Output is correct |
4 |
Correct |
183 ms |
17372 KB |
Output is correct |
5 |
Correct |
161 ms |
15420 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
146 ms |
14932 KB |
Output is correct |
2 |
Correct |
185 ms |
19092 KB |
Output is correct |
3 |
Correct |
168 ms |
18376 KB |
Output is correct |
4 |
Correct |
235 ms |
21576 KB |
Output is correct |
5 |
Correct |
191 ms |
17596 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
179 ms |
19580 KB |
Output is correct |
2 |
Correct |
245 ms |
17624 KB |
Output is correct |
3 |
Correct |
152 ms |
16552 KB |
Output is correct |
4 |
Correct |
217 ms |
21388 KB |
Output is correct |
5 |
Correct |
192 ms |
18400 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
160 ms |
17252 KB |
Output is correct |
2 |
Correct |
202 ms |
22124 KB |
Output is correct |
3 |
Correct |
198 ms |
21380 KB |
Output is correct |
4 |
Correct |
258 ms |
24924 KB |
Output is correct |
5 |
Correct |
216 ms |
20308 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
200 ms |
22780 KB |
Output is correct |
2 |
Correct |
282 ms |
20520 KB |
Output is correct |
3 |
Correct |
194 ms |
19560 KB |
Output is correct |
4 |
Correct |
260 ms |
24764 KB |
Output is correct |
5 |
Correct |
227 ms |
21328 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
188 ms |
19788 KB |
Output is correct |
2 |
Correct |
227 ms |
25228 KB |
Output is correct |
3 |
Correct |
229 ms |
24660 KB |
Output is correct |
4 |
Correct |
286 ms |
28504 KB |
Output is correct |
5 |
Correct |
256 ms |
24008 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
226 ms |
26196 KB |
Output is correct |
2 |
Correct |
312 ms |
23500 KB |
Output is correct |
3 |
Correct |
233 ms |
22292 KB |
Output is correct |
4 |
Correct |
295 ms |
28300 KB |
Output is correct |
5 |
Correct |
269 ms |
24436 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
239 ms |
24664 KB |
Output is correct |
2 |
Correct |
283 ms |
31508 KB |
Output is correct |
3 |
Correct |
284 ms |
30528 KB |
Output is correct |
4 |
Correct |
359 ms |
35180 KB |
Output is correct |
5 |
Correct |
322 ms |
29428 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
280 ms |
32496 KB |
Output is correct |
2 |
Correct |
392 ms |
29132 KB |
Output is correct |
3 |
Correct |
274 ms |
28168 KB |
Output is correct |
4 |
Correct |
374 ms |
35252 KB |
Output is correct |
5 |
Correct |
335 ms |
30668 KB |
Output is correct |