#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 |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 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 |
0 ms |
344 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 |
348 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 |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
540 KB |
Output is correct |
3 |
Correct |
1 ms |
540 KB |
Output is correct |
4 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
348 KB |
Output is correct |
5 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
25 ms |
2652 KB |
Output is correct |
2 |
Correct |
19 ms |
2652 KB |
Output is correct |
3 |
Correct |
13 ms |
2648 KB |
Output is correct |
4 |
Correct |
25 ms |
2648 KB |
Output is correct |
5 |
Correct |
12 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
2652 KB |
Output is correct |
2 |
Correct |
23 ms |
2652 KB |
Output is correct |
3 |
Correct |
27 ms |
2652 KB |
Output is correct |
4 |
Correct |
28 ms |
2880 KB |
Output is correct |
5 |
Correct |
29 ms |
2696 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
20 ms |
2652 KB |
Output is correct |
2 |
Correct |
20 ms |
2652 KB |
Output is correct |
3 |
Correct |
20 ms |
2652 KB |
Output is correct |
4 |
Correct |
35 ms |
2696 KB |
Output is correct |
5 |
Correct |
24 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
25 ms |
2648 KB |
Output is correct |
2 |
Correct |
24 ms |
2652 KB |
Output is correct |
3 |
Correct |
23 ms |
2652 KB |
Output is correct |
4 |
Correct |
33 ms |
2648 KB |
Output is correct |
5 |
Correct |
28 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
2904 KB |
Output is correct |
2 |
Correct |
24 ms |
2648 KB |
Output is correct |
3 |
Correct |
25 ms |
2652 KB |
Output is correct |
4 |
Correct |
35 ms |
2648 KB |
Output is correct |
5 |
Correct |
30 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
105 ms |
8788 KB |
Output is correct |
2 |
Correct |
124 ms |
8788 KB |
Output is correct |
3 |
Correct |
125 ms |
9076 KB |
Output is correct |
4 |
Correct |
168 ms |
8788 KB |
Output is correct |
5 |
Correct |
160 ms |
8788 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
124 ms |
8824 KB |
Output is correct |
2 |
Correct |
182 ms |
8824 KB |
Output is correct |
3 |
Correct |
121 ms |
8832 KB |
Output is correct |
4 |
Correct |
160 ms |
8816 KB |
Output is correct |
5 |
Correct |
158 ms |
9056 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
126 ms |
10836 KB |
Output is correct |
2 |
Correct |
145 ms |
10836 KB |
Output is correct |
3 |
Correct |
145 ms |
10880 KB |
Output is correct |
4 |
Correct |
202 ms |
10836 KB |
Output is correct |
5 |
Correct |
174 ms |
10836 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
147 ms |
10876 KB |
Output is correct |
2 |
Correct |
214 ms |
10864 KB |
Output is correct |
3 |
Correct |
141 ms |
10832 KB |
Output is correct |
4 |
Correct |
205 ms |
10880 KB |
Output is correct |
5 |
Correct |
189 ms |
10872 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
146 ms |
12924 KB |
Output is correct |
2 |
Correct |
168 ms |
12880 KB |
Output is correct |
3 |
Correct |
167 ms |
12936 KB |
Output is correct |
4 |
Correct |
231 ms |
12928 KB |
Output is correct |
5 |
Correct |
215 ms |
12888 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
174 ms |
12932 KB |
Output is correct |
2 |
Correct |
243 ms |
12884 KB |
Output is correct |
3 |
Correct |
167 ms |
12928 KB |
Output is correct |
4 |
Correct |
230 ms |
12880 KB |
Output is correct |
5 |
Correct |
219 ms |
12884 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
172 ms |
15184 KB |
Output is correct |
2 |
Correct |
195 ms |
14928 KB |
Output is correct |
3 |
Correct |
187 ms |
15184 KB |
Output is correct |
4 |
Correct |
281 ms |
14984 KB |
Output is correct |
5 |
Correct |
238 ms |
14984 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
192 ms |
14932 KB |
Output is correct |
2 |
Correct |
274 ms |
14928 KB |
Output is correct |
3 |
Correct |
194 ms |
14976 KB |
Output is correct |
4 |
Correct |
267 ms |
14984 KB |
Output is correct |
5 |
Correct |
233 ms |
14984 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
222 ms |
15956 KB |
Output is correct |
2 |
Correct |
233 ms |
15952 KB |
Output is correct |
3 |
Correct |
232 ms |
15952 KB |
Output is correct |
4 |
Correct |
331 ms |
16252 KB |
Output is correct |
5 |
Correct |
290 ms |
15952 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
243 ms |
16244 KB |
Output is correct |
2 |
Correct |
343 ms |
15992 KB |
Output is correct |
3 |
Correct |
241 ms |
15988 KB |
Output is correct |
4 |
Correct |
334 ms |
15956 KB |
Output is correct |
5 |
Correct |
296 ms |
15952 KB |
Output is correct |