#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 = 1.5e9;
int cnt = 100;
while (r - l > 1e-3){
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(4) << l;
return 0;
}
/*
*/
Compilation message
mobile.cpp: In function 'int main()':
mobile.cpp:39:6: warning: unused variable 'cnt' [-Wunused-variable]
39 | int cnt = 100;
| ^~~
# |
결과 |
실행 시간 |
메모리 |
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 |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
344 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 |
2 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
504 KB |
Output is correct |
2 |
Correct |
2 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
2 ms |
344 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 |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
3 ms |
360 KB |
Output is correct |
5 |
Correct |
3 ms |
352 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
29 ms |
2672 KB |
Output is correct |
2 |
Correct |
20 ms |
2648 KB |
Output is correct |
3 |
Correct |
15 ms |
2648 KB |
Output is correct |
4 |
Correct |
24 ms |
2652 KB |
Output is correct |
5 |
Correct |
13 ms |
2648 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
2688 KB |
Output is correct |
2 |
Correct |
27 ms |
2672 KB |
Output is correct |
3 |
Correct |
36 ms |
2696 KB |
Output is correct |
4 |
Correct |
26 ms |
2688 KB |
Output is correct |
5 |
Correct |
30 ms |
2680 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
2896 KB |
Output is correct |
2 |
Correct |
23 ms |
2696 KB |
Output is correct |
3 |
Correct |
21 ms |
2704 KB |
Output is correct |
4 |
Correct |
34 ms |
2692 KB |
Output is correct |
5 |
Correct |
27 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
2652 KB |
Output is correct |
2 |
Correct |
30 ms |
2696 KB |
Output is correct |
3 |
Correct |
25 ms |
2648 KB |
Output is correct |
4 |
Correct |
46 ms |
2904 KB |
Output is correct |
5 |
Correct |
32 ms |
2660 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
27 ms |
2648 KB |
Output is correct |
2 |
Correct |
27 ms |
2648 KB |
Output is correct |
3 |
Correct |
27 ms |
2648 KB |
Output is correct |
4 |
Correct |
43 ms |
2668 KB |
Output is correct |
5 |
Correct |
35 ms |
2672 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
119 ms |
8176 KB |
Output is correct |
2 |
Correct |
135 ms |
8020 KB |
Output is correct |
3 |
Correct |
135 ms |
8312 KB |
Output is correct |
4 |
Correct |
178 ms |
8256 KB |
Output is correct |
5 |
Correct |
152 ms |
8256 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
134 ms |
8052 KB |
Output is correct |
2 |
Correct |
219 ms |
8300 KB |
Output is correct |
3 |
Correct |
131 ms |
8260 KB |
Output is correct |
4 |
Correct |
175 ms |
8508 KB |
Output is correct |
5 |
Correct |
163 ms |
8264 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
51 ms |
8260 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
73 ms |
16252 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
48 ms |
8060 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
75 ms |
16208 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
59 ms |
8016 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
75 ms |
16492 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
51 ms |
8016 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
88 ms |
16244 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |