#include <bits/stdc++.h>
#define forr(_a,_b,_c) for(_a = (_b); _a <= (_c); ++_a)
#define ford(_a,_b,_c) for(_a = (_b) + 1; _a --> (_c);)
#define forf(_a,_b,_c) for(_a = (_b); _a < (_c); ++_a)
#define st first
#define nd second
#define ll long long
#define ull unsigned long long
#define pii pair <int,int>
#define pll pair <ll,ll>
#define piii pair <int,pii>
#define vi vector <int>
#define pb push_back
#define mp make_pair
#define all(x) begin(x),end(x)
#define file "test"
using namespace std;
const int N = 5e5 + 5;
const ll oo = 1e9;
const ll mod = 1e9 + 7;
int n, ff, i;
pll a[N];
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef hqm
freopen(file".inp", "r", stdin); freopen(file".out", "w", stdout);
#endif
cin >> n >> ff;
forr (i, 1, n)
cin >> a[i].st >> a[i].nd;
double l = 1, r = 2 * oo;
int cnt = 100;
while (cnt--){
double mid = (r + l) / 2, qq = 0;
forr (i, 1, n){
double dis = sqrt(mid * mid - a[i].nd * a[i].nd);
if (a[i].st - dis <= qq)
qq = max (qq, a[i].st + dis);
}
if (qq >= ff)
r = mid;
else l = mid;
}
cout << fixed << setprecision(5) << l;
return 0;
}
/*
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
344 KB |
Output is correct |
2 |
Correct |
2 ms |
344 KB |
Output is correct |
3 |
Correct |
2 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
600 KB |
Output is correct |
3 |
Correct |
3 ms |
344 KB |
Output is correct |
4 |
Correct |
4 ms |
600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
600 KB |
Output is correct |
3 |
Correct |
3 ms |
344 KB |
Output is correct |
4 |
Correct |
3 ms |
600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
344 KB |
Output is correct |
2 |
Correct |
3 ms |
600 KB |
Output is correct |
3 |
Correct |
3 ms |
344 KB |
Output is correct |
4 |
Correct |
4 ms |
480 KB |
Output is correct |
5 |
Correct |
4 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
71 ms |
3416 KB |
Output is correct |
2 |
Correct |
36 ms |
3672 KB |
Output is correct |
3 |
Correct |
26 ms |
3160 KB |
Output is correct |
4 |
Correct |
44 ms |
3672 KB |
Output is correct |
5 |
Correct |
27 ms |
2904 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
41 ms |
3416 KB |
Output is correct |
2 |
Correct |
39 ms |
3416 KB |
Output is correct |
3 |
Correct |
90 ms |
3672 KB |
Output is correct |
4 |
Correct |
51 ms |
3872 KB |
Output is correct |
5 |
Correct |
60 ms |
3928 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
40 ms |
3352 KB |
Output is correct |
2 |
Correct |
37 ms |
3828 KB |
Output is correct |
3 |
Correct |
39 ms |
3416 KB |
Output is correct |
4 |
Correct |
62 ms |
4432 KB |
Output is correct |
5 |
Correct |
49 ms |
3672 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
48 ms |
4432 KB |
Output is correct |
2 |
Correct |
45 ms |
3928 KB |
Output is correct |
3 |
Correct |
45 ms |
3672 KB |
Output is correct |
4 |
Correct |
67 ms |
4696 KB |
Output is correct |
5 |
Correct |
58 ms |
3928 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
45 ms |
4184 KB |
Output is correct |
2 |
Correct |
44 ms |
3928 KB |
Output is correct |
3 |
Correct |
50 ms |
3808 KB |
Output is correct |
4 |
Correct |
63 ms |
4440 KB |
Output is correct |
5 |
Correct |
60 ms |
3928 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
208 ms |
12368 KB |
Output is correct |
2 |
Correct |
225 ms |
15956 KB |
Output is correct |
3 |
Correct |
224 ms |
15440 KB |
Output is correct |
4 |
Correct |
314 ms |
17744 KB |
Output is correct |
5 |
Correct |
292 ms |
15092 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
234 ms |
16628 KB |
Output is correct |
2 |
Correct |
555 ms |
14692 KB |
Output is correct |
3 |
Correct |
225 ms |
13944 KB |
Output is correct |
4 |
Correct |
303 ms |
17744 KB |
Output is correct |
5 |
Correct |
293 ms |
15468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
52 ms |
12624 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
75 ms |
24656 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
49 ms |
12624 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
77 ms |
24768 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
52 ms |
12628 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
74 ms |
24656 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
49 ms |
12624 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
75 ms |
24656 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |