#include <iostream>
#include <cmath>
#include <iomanip>
using ll = long long;
using namespace std;
int N, L;
pair<ll,ll> xy[1000005];
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> N >> L;
for(int i=0;i<N;i++){
cin >> xy[i].first >> xy[i].second;
}
double l = 1, r = 1.5E9;
while(r - l > 1E-4){
double mid = (l+r)/2, curr = 0;
for(int i=0;i<N;i++){
double delta = sqrt(mid*mid - xy[i].second * xy[i].second);
double a = xy[i].first - delta, b = xy[i].first + delta;
if(a<=curr) curr = max(curr,b);
}
if(curr >= L) r = mid;
else l = mid;
}
cout << fixed << setprecision(4) << l << "\n";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
324 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 |
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 |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
392 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
2 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 |
384 KB |
Output is correct |
4 |
Correct |
3 ms |
468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
392 KB |
Output is correct |
2 |
Correct |
2 ms |
464 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 |
468 KB |
Output is correct |
3 |
Correct |
2 ms |
336 KB |
Output is correct |
4 |
Correct |
3 ms |
468 KB |
Output is correct |
5 |
Correct |
2 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
31 ms |
2260 KB |
Output is correct |
2 |
Correct |
26 ms |
2516 KB |
Output is correct |
3 |
Correct |
15 ms |
1772 KB |
Output is correct |
4 |
Correct |
29 ms |
2604 KB |
Output is correct |
5 |
Correct |
14 ms |
1492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
32 ms |
2196 KB |
Output is correct |
2 |
Correct |
25 ms |
2220 KB |
Output is correct |
3 |
Correct |
28 ms |
2596 KB |
Output is correct |
4 |
Correct |
29 ms |
2748 KB |
Output is correct |
5 |
Correct |
36 ms |
3132 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
2388 KB |
Output is correct |
2 |
Correct |
27 ms |
2756 KB |
Output is correct |
3 |
Correct |
24 ms |
2612 KB |
Output is correct |
4 |
Correct |
41 ms |
3808 KB |
Output is correct |
5 |
Correct |
29 ms |
2508 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
32 ms |
3336 KB |
Output is correct |
2 |
Correct |
29 ms |
3240 KB |
Output is correct |
3 |
Correct |
27 ms |
2808 KB |
Output is correct |
4 |
Correct |
42 ms |
3784 KB |
Output is correct |
5 |
Correct |
37 ms |
3112 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
29 ms |
3392 KB |
Output is correct |
2 |
Correct |
28 ms |
3204 KB |
Output is correct |
3 |
Correct |
31 ms |
3020 KB |
Output is correct |
4 |
Correct |
42 ms |
3940 KB |
Output is correct |
5 |
Correct |
35 ms |
3052 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
120 ms |
12344 KB |
Output is correct |
2 |
Correct |
147 ms |
15860 KB |
Output is correct |
3 |
Correct |
146 ms |
15304 KB |
Output is correct |
4 |
Correct |
210 ms |
17732 KB |
Output is correct |
5 |
Correct |
173 ms |
14956 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
146 ms |
16284 KB |
Output is correct |
2 |
Correct |
232 ms |
14804 KB |
Output is correct |
3 |
Correct |
141 ms |
13772 KB |
Output is correct |
4 |
Correct |
207 ms |
17564 KB |
Output is correct |
5 |
Correct |
193 ms |
15552 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
156 ms |
14884 KB |
Output is correct |
2 |
Correct |
186 ms |
19000 KB |
Output is correct |
3 |
Correct |
185 ms |
18440 KB |
Output is correct |
4 |
Correct |
251 ms |
21516 KB |
Output is correct |
5 |
Correct |
218 ms |
17656 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
185 ms |
19624 KB |
Output is correct |
2 |
Correct |
274 ms |
17628 KB |
Output is correct |
3 |
Correct |
197 ms |
16496 KB |
Output is correct |
4 |
Correct |
256 ms |
21556 KB |
Output is correct |
5 |
Correct |
249 ms |
18436 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
186 ms |
17328 KB |
Output is correct |
2 |
Correct |
204 ms |
22120 KB |
Output is correct |
3 |
Correct |
201 ms |
21440 KB |
Output is correct |
4 |
Correct |
297 ms |
24920 KB |
Output is correct |
5 |
Correct |
252 ms |
20308 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
212 ms |
22736 KB |
Output is correct |
2 |
Correct |
306 ms |
20520 KB |
Output is correct |
3 |
Correct |
206 ms |
19652 KB |
Output is correct |
4 |
Correct |
294 ms |
24560 KB |
Output is correct |
5 |
Correct |
259 ms |
21500 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
202 ms |
19772 KB |
Output is correct |
2 |
Correct |
239 ms |
25136 KB |
Output is correct |
3 |
Correct |
232 ms |
24484 KB |
Output is correct |
4 |
Correct |
331 ms |
28492 KB |
Output is correct |
5 |
Correct |
297 ms |
24044 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
262 ms |
26016 KB |
Output is correct |
2 |
Correct |
357 ms |
23408 KB |
Output is correct |
3 |
Correct |
241 ms |
22368 KB |
Output is correct |
4 |
Correct |
339 ms |
28288 KB |
Output is correct |
5 |
Correct |
309 ms |
24492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
242 ms |
24604 KB |
Output is correct |
2 |
Correct |
310 ms |
31516 KB |
Output is correct |
3 |
Correct |
300 ms |
30524 KB |
Output is correct |
4 |
Correct |
417 ms |
35184 KB |
Output is correct |
5 |
Correct |
354 ms |
29568 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
319 ms |
32400 KB |
Output is correct |
2 |
Correct |
435 ms |
29176 KB |
Output is correct |
3 |
Correct |
292 ms |
28144 KB |
Output is correct |
4 |
Correct |
462 ms |
35228 KB |
Output is correct |
5 |
Correct |
372 ms |
30612 KB |
Output is correct |