#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pi pair<int,int>
#define vi vector<int>
#define rep(i,x,n) for(int i=x; i<n; ++i)
#define For(i,n) rep(i,0,n)
#define pb push_back
#define endl "\n"
#define double long double
#define sp ' '
#define f first
#define s second
#define sz size()
#define all(x) (x).begin(),(x).end()
const int N = 3e5+10, OO = 1e18, mod = 1e9+7;
void tr(int a, int b){cout << a << sp << b << endl;}
void cmx(int &a, int b){a = max(a,b);}
void cmn(int &a, int b){a = min(a,b);}
double eps = 1e-6;
vector <pi> v;
double n,L;
bool ok(double m){
double mn = OO, mx = -OO;
For(i,n){
auto [x,y] = v[i];
if(y*y > m*m) continue;
double d = sqrt(m * m - y * y);
if(x - d > mx && mx != -OO) return 0;
if(x-d < mn) mn = x-d;
if(mx < x+d) mx = x+d;
}
return (mn <= 0 && L <= mx);
}
int32_t main() {
ios::sync_with_stdio(0); cin.tie(0);
cin >> n >> L;
For(i,n){
int x,y; cin >> x >> y;
v.pb({x,y});
}
double l = 0, r = 1e10;
For(i,100){
double m = (l+r)/2;
bool b = ok(m);
if(b) r = m;
else l = m;
}
cout << setprecision(20) << r << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 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 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
604 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
604 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
116 ms |
3288 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
39 ms |
3032 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
76 ms |
3028 KB |
Output is correct |
2 |
Correct |
94 ms |
3232 KB |
Output is correct |
3 |
Correct |
62 ms |
3284 KB |
Output is correct |
4 |
Incorrect |
37 ms |
3800 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
97 ms |
3288 KB |
Output is correct |
2 |
Correct |
97 ms |
3544 KB |
Output is correct |
3 |
Correct |
77 ms |
3304 KB |
Output is correct |
4 |
Incorrect |
48 ms |
3796 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
88 ms |
3272 KB |
Output is correct |
2 |
Correct |
92 ms |
3544 KB |
Output is correct |
3 |
Correct |
70 ms |
3284 KB |
Output is correct |
4 |
Incorrect |
43 ms |
3796 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
436 ms |
11196 KB |
Output is correct |
2 |
Correct |
435 ms |
13248 KB |
Output is correct |
3 |
Correct |
453 ms |
13244 KB |
Output is correct |
4 |
Incorrect |
186 ms |
14016 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
452 ms |
12764 KB |
Output is correct |
2 |
Incorrect |
602 ms |
12476 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
524 ms |
19636 KB |
Output is correct |
2 |
Correct |
553 ms |
23480 KB |
Output is correct |
3 |
Correct |
551 ms |
23100 KB |
Output is correct |
4 |
Incorrect |
241 ms |
23708 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
551 ms |
22924 KB |
Output is correct |
2 |
Incorrect |
955 ms |
22024 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
633 ms |
21028 KB |
Output is correct |
2 |
Correct |
647 ms |
23884 KB |
Output is correct |
3 |
Correct |
629 ms |
23548 KB |
Output is correct |
4 |
Incorrect |
331 ms |
24192 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
607 ms |
24248 KB |
Output is correct |
2 |
Incorrect |
913 ms |
22456 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
694 ms |
21948 KB |
Output is correct |
2 |
Correct |
681 ms |
24496 KB |
Output is correct |
3 |
Correct |
665 ms |
24944 KB |
Output is correct |
4 |
Incorrect |
297 ms |
26236 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
685 ms |
22472 KB |
Output is correct |
2 |
Execution timed out |
1037 ms |
23028 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
874 ms |
20832 KB |
Output is correct |
2 |
Correct |
896 ms |
25264 KB |
Output is correct |
3 |
Correct |
866 ms |
25828 KB |
Output is correct |
4 |
Correct |
385 ms |
17332 KB |
Output is correct |
5 |
Incorrect |
458 ms |
17684 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
845 ms |
17908 KB |
Output is correct |
2 |
Execution timed out |
1058 ms |
17732 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |