#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld double
#define F first
#define S second
#define el '\n'
#define cout(x) for(auto v:x)cout<<v<<el
#define coutp(x) for(auto v:x)cout<<v.F<<' '<<v.S<<el
#define cin(x) for(auto &v:x)cin>>v;
#define pb(x) push_back(x)
#define all(x) x.begin(),x.end()
const int N = 5e3 + 5, M = 1e2 + 5, Mod = 1e9 + 7;
int dx[8] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[8] = {0, 0, 1, -1, 1, -1, -1, 1};
int nxt()
{
int x;
cin >> x;
return x;
}
void solve(int h)
{
int n;
ld m;
cin>>n>>m;
ld x[n],y[n];
for(int i=0;i<n;i++)
{
cin>>x[i]>>y[i];
}
ld l=1,r=1.5e9;
while(r-l>1e-3)
{
ld mid=(r+l)/2.0;
ld cur=0;
for(int i=0;i<n;i++)
{
ld dist=sqrt(mid*mid-y[i]*y[i]);
ld left=x[i]-dist;
ld right=x[i]+dist;
if(left<=cur)cur=max(cur,right);
}
if(cur>=m)
r=mid;
else
l=mid;
}
cout<<fixed<<setprecision(4)<<l;
}
int32_t main()
{
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r" , stdin);
// freopen("output.txt", "w", stdout);
// freopen("feast.in", "r", stdin);
// freopen("feast.out", "w", stdout);
// #endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tc = 1;
// cin >> tc;
for (int i = 1; i <= tc; i++)solve(i);
return 0;
}
# |
Verdict |
Execution time |
Memory |
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 |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
456 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
512 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
516 KB |
Output is correct |
2 |
Correct |
4 ms |
348 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
3 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
596 KB |
Output is correct |
3 |
Correct |
3 ms |
568 KB |
Output is correct |
4 |
Correct |
3 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
344 KB |
Output is correct |
2 |
Correct |
2 ms |
464 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
3 ms |
604 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
35 ms |
2396 KB |
Output is correct |
2 |
Correct |
34 ms |
2648 KB |
Output is correct |
3 |
Correct |
21 ms |
1884 KB |
Output is correct |
4 |
Correct |
36 ms |
2652 KB |
Output is correct |
5 |
Correct |
19 ms |
1628 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
34 ms |
2296 KB |
Output is correct |
2 |
Correct |
32 ms |
2364 KB |
Output is correct |
3 |
Correct |
48 ms |
2704 KB |
Output is correct |
4 |
Correct |
37 ms |
2688 KB |
Output is correct |
5 |
Correct |
40 ms |
3280 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
32 ms |
2500 KB |
Output is correct |
2 |
Correct |
39 ms |
2652 KB |
Output is correct |
3 |
Correct |
35 ms |
2652 KB |
Output is correct |
4 |
Correct |
52 ms |
3676 KB |
Output is correct |
5 |
Correct |
37 ms |
2724 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
42 ms |
3420 KB |
Output is correct |
2 |
Correct |
39 ms |
3400 KB |
Output is correct |
3 |
Correct |
38 ms |
2904 KB |
Output is correct |
4 |
Correct |
56 ms |
3536 KB |
Output is correct |
5 |
Correct |
42 ms |
3152 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
42 ms |
3416 KB |
Output is correct |
2 |
Correct |
40 ms |
3272 KB |
Output is correct |
3 |
Correct |
39 ms |
2908 KB |
Output is correct |
4 |
Correct |
50 ms |
3668 KB |
Output is correct |
5 |
Correct |
46 ms |
3160 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
206 ms |
11860 KB |
Output is correct |
2 |
Correct |
215 ms |
14576 KB |
Output is correct |
3 |
Correct |
198 ms |
14164 KB |
Output is correct |
4 |
Correct |
240 ms |
15952 KB |
Output is correct |
5 |
Correct |
213 ms |
14016 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
199 ms |
15136 KB |
Output is correct |
2 |
Correct |
255 ms |
13740 KB |
Output is correct |
3 |
Correct |
188 ms |
13000 KB |
Output is correct |
4 |
Correct |
233 ms |
15700 KB |
Output is correct |
5 |
Correct |
222 ms |
14164 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
229 ms |
14220 KB |
Output is correct |
2 |
Correct |
241 ms |
17484 KB |
Output is correct |
3 |
Correct |
237 ms |
16728 KB |
Output is correct |
4 |
Correct |
299 ms |
19124 KB |
Output is correct |
5 |
Correct |
274 ms |
16472 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
247 ms |
17996 KB |
Output is correct |
2 |
Correct |
328 ms |
16220 KB |
Output is correct |
3 |
Correct |
229 ms |
15696 KB |
Output is correct |
4 |
Correct |
302 ms |
19152 KB |
Output is correct |
5 |
Correct |
276 ms |
16936 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
257 ms |
16280 KB |
Output is correct |
2 |
Correct |
276 ms |
20304 KB |
Output is correct |
3 |
Correct |
326 ms |
19536 KB |
Output is correct |
4 |
Correct |
358 ms |
21908 KB |
Output is correct |
5 |
Correct |
337 ms |
18768 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
294 ms |
20564 KB |
Output is correct |
2 |
Correct |
363 ms |
18896 KB |
Output is correct |
3 |
Correct |
295 ms |
18260 KB |
Output is correct |
4 |
Correct |
333 ms |
22136 KB |
Output is correct |
5 |
Correct |
308 ms |
21328 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
284 ms |
18712 KB |
Output is correct |
2 |
Correct |
321 ms |
22868 KB |
Output is correct |
3 |
Correct |
304 ms |
22356 KB |
Output is correct |
4 |
Correct |
365 ms |
25428 KB |
Output is correct |
5 |
Correct |
334 ms |
23952 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
318 ms |
23316 KB |
Output is correct |
2 |
Correct |
381 ms |
21584 KB |
Output is correct |
3 |
Correct |
290 ms |
20888 KB |
Output is correct |
4 |
Correct |
437 ms |
25100 KB |
Output is correct |
5 |
Correct |
356 ms |
24356 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
378 ms |
23000 KB |
Output is correct |
2 |
Correct |
409 ms |
28424 KB |
Output is correct |
3 |
Correct |
404 ms |
27472 KB |
Output is correct |
4 |
Correct |
537 ms |
31148 KB |
Output is correct |
5 |
Correct |
458 ms |
29620 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
422 ms |
29008 KB |
Output is correct |
2 |
Correct |
505 ms |
26704 KB |
Output is correct |
3 |
Correct |
390 ms |
28248 KB |
Output is correct |
4 |
Correct |
534 ms |
35412 KB |
Output is correct |
5 |
Correct |
509 ms |
30804 KB |
Output is correct |