#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 |
1 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 |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
324 KB |
Output is correct |
3 |
Correct |
1 ms |
260 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
2 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 |
3 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
468 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
3 ms |
596 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
468 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
2 ms |
468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 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 |
2 ms |
468 KB |
Output is correct |
5 |
Correct |
2 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
1492 KB |
Output is correct |
2 |
Correct |
24 ms |
1492 KB |
Output is correct |
3 |
Correct |
13 ms |
1748 KB |
Output is correct |
4 |
Correct |
23 ms |
2644 KB |
Output is correct |
5 |
Correct |
13 ms |
1492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
1492 KB |
Output is correct |
2 |
Correct |
27 ms |
2128 KB |
Output is correct |
3 |
Correct |
24 ms |
2664 KB |
Output is correct |
4 |
Correct |
30 ms |
2784 KB |
Output is correct |
5 |
Correct |
27 ms |
3156 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
20 ms |
1620 KB |
Output is correct |
2 |
Correct |
21 ms |
1536 KB |
Output is correct |
3 |
Correct |
21 ms |
2516 KB |
Output is correct |
4 |
Correct |
33 ms |
3736 KB |
Output is correct |
5 |
Correct |
31 ms |
2516 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
33 ms |
1876 KB |
Output is correct |
2 |
Correct |
25 ms |
3176 KB |
Output is correct |
3 |
Correct |
27 ms |
2900 KB |
Output is correct |
4 |
Correct |
33 ms |
3796 KB |
Output is correct |
5 |
Correct |
29 ms |
3020 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
25 ms |
1888 KB |
Output is correct |
2 |
Correct |
27 ms |
1876 KB |
Output is correct |
3 |
Correct |
30 ms |
2888 KB |
Output is correct |
4 |
Correct |
48 ms |
3796 KB |
Output is correct |
5 |
Correct |
42 ms |
3156 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
106 ms |
8036 KB |
Output is correct |
2 |
Correct |
130 ms |
15964 KB |
Output is correct |
3 |
Correct |
131 ms |
15324 KB |
Output is correct |
4 |
Correct |
180 ms |
17740 KB |
Output is correct |
5 |
Correct |
162 ms |
14960 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
124 ms |
8260 KB |
Output is correct |
2 |
Correct |
185 ms |
14720 KB |
Output is correct |
3 |
Correct |
132 ms |
13900 KB |
Output is correct |
4 |
Correct |
183 ms |
17408 KB |
Output is correct |
5 |
Correct |
157 ms |
15420 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
140 ms |
9708 KB |
Output is correct |
2 |
Correct |
155 ms |
18960 KB |
Output is correct |
3 |
Correct |
162 ms |
18388 KB |
Output is correct |
4 |
Correct |
212 ms |
21584 KB |
Output is correct |
5 |
Correct |
171 ms |
17588 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
154 ms |
9668 KB |
Output is correct |
2 |
Correct |
265 ms |
17524 KB |
Output is correct |
3 |
Correct |
142 ms |
16540 KB |
Output is correct |
4 |
Correct |
193 ms |
21440 KB |
Output is correct |
5 |
Correct |
191 ms |
18424 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
153 ms |
11212 KB |
Output is correct |
2 |
Correct |
182 ms |
22092 KB |
Output is correct |
3 |
Correct |
175 ms |
21312 KB |
Output is correct |
4 |
Correct |
237 ms |
24792 KB |
Output is correct |
5 |
Correct |
212 ms |
20308 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
187 ms |
11272 KB |
Output is correct |
2 |
Correct |
255 ms |
20516 KB |
Output is correct |
3 |
Correct |
171 ms |
19656 KB |
Output is correct |
4 |
Correct |
252 ms |
24636 KB |
Output is correct |
5 |
Correct |
200 ms |
21324 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
228 ms |
12748 KB |
Output is correct |
2 |
Correct |
209 ms |
25232 KB |
Output is correct |
3 |
Correct |
194 ms |
24336 KB |
Output is correct |
4 |
Correct |
269 ms |
28412 KB |
Output is correct |
5 |
Correct |
239 ms |
23968 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
198 ms |
12840 KB |
Output is correct |
2 |
Correct |
278 ms |
23312 KB |
Output is correct |
3 |
Correct |
189 ms |
22364 KB |
Output is correct |
4 |
Correct |
268 ms |
28320 KB |
Output is correct |
5 |
Correct |
241 ms |
24432 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
310 ms |
15952 KB |
Output is correct |
2 |
Correct |
245 ms |
31476 KB |
Output is correct |
3 |
Correct |
244 ms |
30456 KB |
Output is correct |
4 |
Correct |
326 ms |
35136 KB |
Output is correct |
5 |
Correct |
292 ms |
29456 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
248 ms |
16352 KB |
Output is correct |
2 |
Correct |
337 ms |
29132 KB |
Output is correct |
3 |
Correct |
245 ms |
28380 KB |
Output is correct |
4 |
Correct |
327 ms |
35160 KB |
Output is correct |
5 |
Correct |
289 ms |
30668 KB |
Output is correct |