#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;
}
# |
결과 |
실행 시간 |
메모리 |
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 |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
2 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 |
472 KB |
Output is correct |
3 |
Correct |
2 ms |
388 KB |
Output is correct |
4 |
Correct |
3 ms |
468 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 |
340 KB |
Output is correct |
4 |
Correct |
3 ms |
468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
436 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
3 ms |
468 KB |
Output is correct |
5 |
Correct |
3 ms |
336 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
31 ms |
1468 KB |
Output is correct |
2 |
Correct |
23 ms |
2524 KB |
Output is correct |
3 |
Correct |
14 ms |
1748 KB |
Output is correct |
4 |
Correct |
26 ms |
2644 KB |
Output is correct |
5 |
Correct |
14 ms |
1404 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
1492 KB |
Output is correct |
2 |
Correct |
23 ms |
2220 KB |
Output is correct |
3 |
Correct |
30 ms |
2616 KB |
Output is correct |
4 |
Correct |
26 ms |
2752 KB |
Output is correct |
5 |
Correct |
30 ms |
3060 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
20 ms |
1684 KB |
Output is correct |
2 |
Correct |
24 ms |
1584 KB |
Output is correct |
3 |
Correct |
23 ms |
2560 KB |
Output is correct |
4 |
Correct |
37 ms |
3728 KB |
Output is correct |
5 |
Correct |
26 ms |
2508 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
28 ms |
1816 KB |
Output is correct |
2 |
Correct |
30 ms |
3276 KB |
Output is correct |
3 |
Correct |
26 ms |
2800 KB |
Output is correct |
4 |
Correct |
38 ms |
3736 KB |
Output is correct |
5 |
Correct |
31 ms |
3028 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
28 ms |
1868 KB |
Output is correct |
2 |
Correct |
27 ms |
1792 KB |
Output is correct |
3 |
Correct |
28 ms |
2804 KB |
Output is correct |
4 |
Correct |
41 ms |
3740 KB |
Output is correct |
5 |
Correct |
33 ms |
3160 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
112 ms |
8104 KB |
Output is correct |
2 |
Correct |
140 ms |
15876 KB |
Output is correct |
3 |
Correct |
151 ms |
15432 KB |
Output is correct |
4 |
Correct |
196 ms |
17740 KB |
Output is correct |
5 |
Correct |
157 ms |
14856 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
139 ms |
8104 KB |
Output is correct |
2 |
Correct |
210 ms |
14656 KB |
Output is correct |
3 |
Correct |
128 ms |
13884 KB |
Output is correct |
4 |
Correct |
180 ms |
17464 KB |
Output is correct |
5 |
Correct |
169 ms |
15372 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
141 ms |
9704 KB |
Output is correct |
2 |
Correct |
193 ms |
18892 KB |
Output is correct |
3 |
Correct |
172 ms |
18352 KB |
Output is correct |
4 |
Correct |
239 ms |
21572 KB |
Output is correct |
5 |
Correct |
195 ms |
17680 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
180 ms |
9708 KB |
Output is correct |
2 |
Correct |
257 ms |
17612 KB |
Output is correct |
3 |
Correct |
164 ms |
16604 KB |
Output is correct |
4 |
Correct |
241 ms |
21416 KB |
Output is correct |
5 |
Correct |
206 ms |
18408 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
179 ms |
11456 KB |
Output is correct |
2 |
Correct |
222 ms |
22092 KB |
Output is correct |
3 |
Correct |
195 ms |
21416 KB |
Output is correct |
4 |
Correct |
277 ms |
24784 KB |
Output is correct |
5 |
Correct |
226 ms |
20368 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
208 ms |
11212 KB |
Output is correct |
2 |
Correct |
291 ms |
20588 KB |
Output is correct |
3 |
Correct |
206 ms |
19632 KB |
Output is correct |
4 |
Correct |
263 ms |
24640 KB |
Output is correct |
5 |
Correct |
255 ms |
21444 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
186 ms |
12840 KB |
Output is correct |
2 |
Correct |
260 ms |
25292 KB |
Output is correct |
3 |
Correct |
247 ms |
24448 KB |
Output is correct |
4 |
Correct |
305 ms |
28456 KB |
Output is correct |
5 |
Correct |
280 ms |
23980 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
240 ms |
12824 KB |
Output is correct |
2 |
Correct |
338 ms |
23392 KB |
Output is correct |
3 |
Correct |
225 ms |
22328 KB |
Output is correct |
4 |
Correct |
306 ms |
28364 KB |
Output is correct |
5 |
Correct |
273 ms |
24388 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
243 ms |
15920 KB |
Output is correct |
2 |
Correct |
306 ms |
31576 KB |
Output is correct |
3 |
Correct |
298 ms |
30484 KB |
Output is correct |
4 |
Correct |
398 ms |
27468 KB |
Output is correct |
5 |
Correct |
330 ms |
29556 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
297 ms |
15940 KB |
Output is correct |
2 |
Correct |
417 ms |
29248 KB |
Output is correct |
3 |
Correct |
288 ms |
28232 KB |
Output is correct |
4 |
Correct |
394 ms |
27204 KB |
Output is correct |
5 |
Correct |
335 ms |
30736 KB |
Output is correct |