#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#include <bits/stdc++.h>
using namespace std;
#define sqr 547
#define mp make_pair
#define mid (l+r)/2
#define pb push_back
#define ppb pop_back
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define ins insert
#define era erase
#define C continue
#define mem(dp,i) memset(dp,i,sizeof(dp))
#define mset multiset
#define all(x) x.begin(), x.end()
typedef long long ll;
typedef short int si;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
const ll inf=1e18;
const ll mod=1e9+7;
const ld pai=acos(-1);
ll N , En ;
pll A [1000009] ;
bool Check ( double Mid ) {
double Mx = 0 ;
for ( int i = 0 ; i < N ; i ++ ) {
double Len = sqrt ( Mid * Mid - A [i] .se * A [i] .se ) ;
double L = A [i].fi - Len , R = A [i].fi + Len ;
if ( L <= Mx ) Mx = max ( Mx , R ) ;
}
return ( Mx >= En ) ;
}
int main () {
cin >> N >> En ;
for ( int i = 0 ; i < N ; i ++ ) cin >> A [i] .fi >> A [i] .se ;
double L = 1 , R = 5e8 ;
while ( R - L > 0.001 ) {
double Mid = ( L + R ) / 2.0 ;
if ( Check ( Mid ) ) R = Mid ;
else L = Mid ;
}
cout << fixed << setprecision (4) << L << endl ;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
384 KB |
Output is correct |
2 |
Correct |
4 ms |
256 KB |
Output is correct |
3 |
Correct |
4 ms |
256 KB |
Output is correct |
4 |
Correct |
5 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
384 KB |
Output is correct |
2 |
Correct |
6 ms |
384 KB |
Output is correct |
3 |
Correct |
6 ms |
384 KB |
Output is correct |
4 |
Correct |
7 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
384 KB |
Output is correct |
2 |
Correct |
10 ms |
512 KB |
Output is correct |
3 |
Correct |
8 ms |
384 KB |
Output is correct |
4 |
Correct |
11 ms |
512 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
512 KB |
Output is correct |
2 |
Correct |
9 ms |
512 KB |
Output is correct |
3 |
Correct |
9 ms |
512 KB |
Output is correct |
4 |
Correct |
11 ms |
512 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
384 KB |
Output is correct |
2 |
Correct |
9 ms |
384 KB |
Output is correct |
3 |
Correct |
8 ms |
384 KB |
Output is correct |
4 |
Correct |
13 ms |
384 KB |
Output is correct |
5 |
Correct |
9 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
84 ms |
1528 KB |
Output is correct |
2 |
Correct |
84 ms |
2552 KB |
Output is correct |
3 |
Correct |
55 ms |
1784 KB |
Output is correct |
4 |
Correct |
102 ms |
2680 KB |
Output is correct |
5 |
Correct |
46 ms |
1532 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
80 ms |
1528 KB |
Output is correct |
2 |
Correct |
81 ms |
2296 KB |
Output is correct |
3 |
Correct |
98 ms |
2680 KB |
Output is correct |
4 |
Correct |
106 ms |
2808 KB |
Output is correct |
5 |
Correct |
127 ms |
3192 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
69 ms |
1656 KB |
Output is correct |
2 |
Correct |
90 ms |
1656 KB |
Output is correct |
3 |
Correct |
85 ms |
1696 KB |
Output is correct |
4 |
Correct |
159 ms |
1912 KB |
Output is correct |
5 |
Correct |
95 ms |
2680 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
115 ms |
1912 KB |
Output is correct |
2 |
Correct |
108 ms |
1912 KB |
Output is correct |
3 |
Correct |
94 ms |
1912 KB |
Output is correct |
4 |
Correct |
157 ms |
1912 KB |
Output is correct |
5 |
Correct |
120 ms |
3204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
116 ms |
1912 KB |
Output is correct |
2 |
Correct |
109 ms |
1912 KB |
Output is correct |
3 |
Correct |
96 ms |
1912 KB |
Output is correct |
4 |
Correct |
158 ms |
1912 KB |
Output is correct |
5 |
Correct |
127 ms |
3192 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
413 ms |
8184 KB |
Output is correct |
2 |
Correct |
560 ms |
15864 KB |
Output is correct |
3 |
Correct |
546 ms |
15352 KB |
Output is correct |
4 |
Correct |
768 ms |
17784 KB |
Output is correct |
5 |
Correct |
602 ms |
14968 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
580 ms |
8256 KB |
Output is correct |
2 |
Correct |
616 ms |
14844 KB |
Output is correct |
3 |
Correct |
488 ms |
14036 KB |
Output is correct |
4 |
Correct |
746 ms |
17792 KB |
Output is correct |
5 |
Correct |
638 ms |
15608 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
479 ms |
9720 KB |
Output is correct |
2 |
Correct |
681 ms |
19296 KB |
Output is correct |
3 |
Correct |
641 ms |
18476 KB |
Output is correct |
4 |
Correct |
960 ms |
21712 KB |
Output is correct |
5 |
Correct |
734 ms |
17768 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
693 ms |
9848 KB |
Output is correct |
2 |
Correct |
737 ms |
17784 KB |
Output is correct |
3 |
Correct |
586 ms |
16632 KB |
Output is correct |
4 |
Correct |
931 ms |
21624 KB |
Output is correct |
5 |
Correct |
764 ms |
18588 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
553 ms |
11332 KB |
Output is correct |
2 |
Correct |
817 ms |
22264 KB |
Output is correct |
3 |
Correct |
767 ms |
21576 KB |
Output is correct |
4 |
Execution timed out |
1070 ms |
24824 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
826 ms |
11492 KB |
Output is correct |
2 |
Correct |
843 ms |
20672 KB |
Output is correct |
3 |
Correct |
701 ms |
19704 KB |
Output is correct |
4 |
Execution timed out |
1074 ms |
24824 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
658 ms |
13048 KB |
Output is correct |
2 |
Correct |
905 ms |
25464 KB |
Output is correct |
3 |
Correct |
906 ms |
24612 KB |
Output is correct |
4 |
Execution timed out |
1095 ms |
28536 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
941 ms |
13148 KB |
Output is correct |
2 |
Execution timed out |
1012 ms |
23416 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
802 ms |
16376 KB |
Output is correct |
2 |
Execution timed out |
1058 ms |
31736 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1091 ms |
16124 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |