#include <iostream>
#include <iomanip>
#include <cmath>
#define ll long long
using namespace std;
ll n,len;
pair<ll,ll> a[1000005];
//ll lungimi[1000006];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin>>n>>len;
for (int i = 1;i<=n;++i) {
cin>>a[i].first>>a[i].second;
}
double l = 1,r = 1.5e9;
while(r-l>1e-3) {
double mid = (l+r)/2,curr = 0;
for (int i = 1;i<=n;++i) {
// aflam prt dr si st
double st,dr,dif;
dif = sqrt((mid*mid)-(a[i].second*a[i].second));
st = a[i].first-dif,dr = a[i].first+dif;
if (st<=curr) {
curr=max(curr,dr);
}
}
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 |
1 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 |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
416 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
600 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
548 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
344 KB |
Output is correct |
2 |
Correct |
2 ms |
608 KB |
Output is correct |
3 |
Correct |
2 ms |
344 KB |
Output is correct |
4 |
Correct |
3 ms |
860 KB |
Output is correct |
5 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
3420 KB |
Output is correct |
2 |
Correct |
19 ms |
3672 KB |
Output is correct |
3 |
Correct |
14 ms |
3316 KB |
Output is correct |
4 |
Correct |
26 ms |
3676 KB |
Output is correct |
5 |
Correct |
14 ms |
2904 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
23 ms |
3420 KB |
Output is correct |
2 |
Correct |
21 ms |
3420 KB |
Output is correct |
3 |
Correct |
26 ms |
3676 KB |
Output is correct |
4 |
Correct |
24 ms |
3676 KB |
Output is correct |
5 |
Correct |
28 ms |
3932 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
19 ms |
3372 KB |
Output is correct |
2 |
Correct |
21 ms |
3672 KB |
Output is correct |
3 |
Correct |
21 ms |
3580 KB |
Output is correct |
4 |
Correct |
35 ms |
4696 KB |
Output is correct |
5 |
Correct |
24 ms |
3412 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
30 ms |
4184 KB |
Output is correct |
2 |
Correct |
25 ms |
3956 KB |
Output is correct |
3 |
Correct |
23 ms |
3676 KB |
Output is correct |
4 |
Correct |
35 ms |
4444 KB |
Output is correct |
5 |
Correct |
29 ms |
3776 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
4188 KB |
Output is correct |
2 |
Correct |
24 ms |
4084 KB |
Output is correct |
3 |
Correct |
26 ms |
3704 KB |
Output is correct |
4 |
Correct |
34 ms |
4444 KB |
Output is correct |
5 |
Correct |
29 ms |
3928 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
107 ms |
13124 KB |
Output is correct |
2 |
Correct |
129 ms |
16364 KB |
Output is correct |
3 |
Correct |
123 ms |
15992 KB |
Output is correct |
4 |
Correct |
168 ms |
18252 KB |
Output is correct |
5 |
Correct |
150 ms |
15792 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
127 ms |
16876 KB |
Output is correct |
2 |
Correct |
185 ms |
15440 KB |
Output is correct |
3 |
Correct |
119 ms |
14832 KB |
Output is correct |
4 |
Correct |
183 ms |
18180 KB |
Output is correct |
5 |
Correct |
147 ms |
16136 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
129 ms |
16108 KB |
Output is correct |
2 |
Correct |
147 ms |
19956 KB |
Output is correct |
3 |
Correct |
144 ms |
19584 KB |
Output is correct |
4 |
Correct |
234 ms |
22912 KB |
Output is correct |
5 |
Correct |
179 ms |
18772 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
152 ms |
20724 KB |
Output is correct |
2 |
Correct |
218 ms |
19060 KB |
Output is correct |
3 |
Correct |
140 ms |
17528 KB |
Output is correct |
4 |
Correct |
202 ms |
22624 KB |
Output is correct |
5 |
Correct |
180 ms |
19540 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
148 ms |
18772 KB |
Output is correct |
2 |
Correct |
170 ms |
23632 KB |
Output is correct |
3 |
Correct |
178 ms |
23100 KB |
Output is correct |
4 |
Correct |
232 ms |
26380 KB |
Output is correct |
5 |
Correct |
205 ms |
21844 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
179 ms |
24692 KB |
Output is correct |
2 |
Correct |
245 ms |
22104 KB |
Output is correct |
3 |
Correct |
168 ms |
21236 KB |
Output is correct |
4 |
Correct |
243 ms |
26488 KB |
Output is correct |
5 |
Correct |
210 ms |
23036 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
169 ms |
21840 KB |
Output is correct |
2 |
Correct |
194 ms |
27520 KB |
Output is correct |
3 |
Correct |
191 ms |
26484 KB |
Output is correct |
4 |
Correct |
273 ms |
30572 KB |
Output is correct |
5 |
Correct |
243 ms |
25940 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
200 ms |
28148 KB |
Output is correct |
2 |
Correct |
288 ms |
25864 KB |
Output is correct |
3 |
Correct |
195 ms |
24300 KB |
Output is correct |
4 |
Correct |
277 ms |
30544 KB |
Output is correct |
5 |
Correct |
245 ms |
26452 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
218 ms |
24788 KB |
Output is correct |
2 |
Correct |
250 ms |
32084 KB |
Output is correct |
3 |
Correct |
250 ms |
30448 KB |
Output is correct |
4 |
Correct |
339 ms |
35432 KB |
Output is correct |
5 |
Correct |
307 ms |
29548 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
265 ms |
32748 KB |
Output is correct |
2 |
Correct |
362 ms |
29232 KB |
Output is correct |
3 |
Correct |
245 ms |
28500 KB |
Output is correct |
4 |
Correct |
350 ms |
35180 KB |
Output is correct |
5 |
Correct |
324 ms |
30952 KB |
Output is correct |