#include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
pair<long long, long long> p[1000000];
int main() {
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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
352 KB |
Output is correct |
2 |
Correct |
1 ms |
352 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
356 KB |
Output is correct |
2 |
Correct |
3 ms |
456 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
3 ms |
352 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
352 KB |
Output is correct |
2 |
Correct |
4 ms |
348 KB |
Output is correct |
3 |
Correct |
2 ms |
344 KB |
Output is correct |
4 |
Correct |
3 ms |
600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
3 ms |
352 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
3 ms |
348 KB |
Output is correct |
5 |
Correct |
4 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
41 ms |
2380 KB |
Output is correct |
2 |
Correct |
37 ms |
2644 KB |
Output is correct |
3 |
Correct |
24 ms |
1856 KB |
Output is correct |
4 |
Correct |
45 ms |
2652 KB |
Output is correct |
5 |
Correct |
21 ms |
1628 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
35 ms |
2400 KB |
Output is correct |
2 |
Correct |
38 ms |
2152 KB |
Output is correct |
3 |
Correct |
42 ms |
2588 KB |
Output is correct |
4 |
Correct |
47 ms |
2728 KB |
Output is correct |
5 |
Correct |
56 ms |
3204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
31 ms |
2396 KB |
Output is correct |
2 |
Correct |
43 ms |
2644 KB |
Output is correct |
3 |
Correct |
46 ms |
2644 KB |
Output is correct |
4 |
Correct |
71 ms |
3668 KB |
Output is correct |
5 |
Correct |
43 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
53 ms |
3408 KB |
Output is correct |
2 |
Correct |
52 ms |
3372 KB |
Output is correct |
3 |
Correct |
43 ms |
3008 KB |
Output is correct |
4 |
Correct |
70 ms |
3768 KB |
Output is correct |
5 |
Correct |
53 ms |
3164 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
52 ms |
3408 KB |
Output is correct |
2 |
Correct |
52 ms |
3156 KB |
Output is correct |
3 |
Correct |
42 ms |
2896 KB |
Output is correct |
4 |
Correct |
73 ms |
3920 KB |
Output is correct |
5 |
Correct |
52 ms |
3156 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
189 ms |
12372 KB |
Output is correct |
2 |
Correct |
253 ms |
15952 KB |
Output is correct |
3 |
Correct |
248 ms |
15700 KB |
Output is correct |
4 |
Correct |
347 ms |
17708 KB |
Output is correct |
5 |
Correct |
303 ms |
14928 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
279 ms |
16212 KB |
Output is correct |
2 |
Correct |
313 ms |
15008 KB |
Output is correct |
3 |
Correct |
229 ms |
13908 KB |
Output is correct |
4 |
Correct |
333 ms |
17492 KB |
Output is correct |
5 |
Correct |
349 ms |
15440 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
222 ms |
14976 KB |
Output is correct |
2 |
Correct |
301 ms |
18872 KB |
Output is correct |
3 |
Correct |
325 ms |
18260 KB |
Output is correct |
4 |
Correct |
417 ms |
21584 KB |
Output is correct |
5 |
Correct |
341 ms |
17744 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
303 ms |
19540 KB |
Output is correct |
2 |
Correct |
379 ms |
17652 KB |
Output is correct |
3 |
Correct |
266 ms |
16464 KB |
Output is correct |
4 |
Correct |
411 ms |
21504 KB |
Output is correct |
5 |
Correct |
331 ms |
18516 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
261 ms |
17404 KB |
Output is correct |
2 |
Correct |
382 ms |
21960 KB |
Output is correct |
3 |
Correct |
353 ms |
21328 KB |
Output is correct |
4 |
Correct |
453 ms |
24656 KB |
Output is correct |
5 |
Correct |
381 ms |
20392 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
394 ms |
22864 KB |
Output is correct |
2 |
Correct |
435 ms |
20620 KB |
Output is correct |
3 |
Correct |
311 ms |
19536 KB |
Output is correct |
4 |
Correct |
474 ms |
24656 KB |
Output is correct |
5 |
Correct |
424 ms |
21384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
323 ms |
19792 KB |
Output is correct |
2 |
Correct |
455 ms |
25120 KB |
Output is correct |
3 |
Correct |
413 ms |
24400 KB |
Output is correct |
4 |
Correct |
567 ms |
28500 KB |
Output is correct |
5 |
Correct |
464 ms |
24100 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
439 ms |
26000 KB |
Output is correct |
2 |
Correct |
546 ms |
23476 KB |
Output is correct |
3 |
Correct |
430 ms |
22352 KB |
Output is correct |
4 |
Correct |
552 ms |
28400 KB |
Output is correct |
5 |
Correct |
453 ms |
24400 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
381 ms |
24572 KB |
Output is correct |
2 |
Correct |
536 ms |
31660 KB |
Output is correct |
3 |
Correct |
495 ms |
30384 KB |
Output is correct |
4 |
Correct |
707 ms |
35100 KB |
Output is correct |
5 |
Correct |
550 ms |
29500 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
559 ms |
32520 KB |
Output is correct |
2 |
Correct |
621 ms |
29264 KB |
Output is correct |
3 |
Correct |
461 ms |
28148 KB |
Output is correct |
4 |
Correct |
715 ms |
35304 KB |
Output is correct |
5 |
Correct |
580 ms |
30804 KB |
Output is correct |