#ifdef LOCAL
//#include "librerie locali/debugging.h"
#else
#pragma GCC optimize("Ofast,unroll-loops")
#endif
#include <bits/stdc++.h>
using namespace std;
#define rep(i, x) for (int i = 0; i < (x); i++)
#define reps(i,j,x) for(int i=(j);i<(x);i++)
#define repp(i,x) for(int i = 1; i <= (x); i++)
#define all(a) a.begin(),a.end()
#define allr(a) a.rbegin(),a.rend()
#define maxint numeric_limits<int>::max()
#define minint numeric_limits<int>::min()
#define maxll numeric_limits<ll>::max()
#define minll numeric_limits<ll>::min()
#define nl '\n'
#define f first
#define s second
#define pb push_back
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
typedef vector<vpi> vvpi;
typedef vector<vpll> vvpll;
typedef array<int, 3> i3;
typedef array<ll, 3> ll3;
typedef array<int, 4> i4;
typedef array<ll, 4> ll4;
typedef vector<i3> vi3;
typedef vector<ll3> vll3;
typedef vector<i4> vi4;
typedef vector<ll4> vll4;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
int nxt() {int x;cin >> x;return x;}
template <class T> void make_unique(T &arr) {sort(all(arr)); arr.resize(unique(all(arr)) - arr.begin());}
void print(){cout<<endl;} template <typename T, typename... Types> void print(T var1, Types... var2) {cout<<var1<<" ";print(var2...);}
template <typename T> T maxm(T var) {return var;} template <typename T, typename... Types> T maxm(T var1, Types... var2) {return max(var1,maxm(var2...));}
template <typename T> T minm(T var) {return var;} template <typename T, typename... Types> T minm(T var1, Types... var2) {return min(var1,minm(var2...));}
ll lpow(ll base, ll exp){ll result = 1;for (;;){if (exp & 1)result *= base;exp >>= 1;if (!exp)break;base *= base;}return result;}
int log2_floor(unsigned long long i) {return i ? __builtin_clzll(1) - __builtin_clzll(i) : 0;}
template <typename T> T maxv(vector<T> &var) {T maxi=numeric_limits<T>::min();for(auto x : var)maxi=max(maxi,x);return maxi;}
template <typename T> T minv(vector<T> &var) {T mini=numeric_limits<T>::max();for(auto x : var)mini=min(mini,x);return mini;}
void solve();
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
#ifdef LOCAL
freopen("balancing.in", "r", stdin);
#endif
//freopen("balancing.out", "w", stdout);
int t=1;
//cin>>t;
rep(i,t)solve();
}
#define mod 998244353
void solve(){
ll n,l;
cin>>n>>l;
vpll arr(n);
rep(i,n)cin>>arr[i].f>>arr[i].s;
auto f = [&](double r){
double d = 0;
rep(i,n){
double tem = sqrt(r*r-arr[i].s*arr[i].s);
double a1= arr[i].f-tem,a2=arr[i].f+tem;
if(a1<d)d=max(d,a2);
}
return d>=l;
};
double x = 1e9;
for(double i = 1e9;i>1e-4;i/=2){
while(f(x-i))x-=i;
}
cout<<fixed<<setprecision(5)<<x<<nl;
}
# |
결과 |
실행 시간 |
메모리 |
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 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
600 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
344 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 |
552 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 |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
532 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
3 ms |
604 KB |
Output is correct |
5 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
39 ms |
1628 KB |
Output is correct |
2 |
Correct |
25 ms |
2648 KB |
Output is correct |
3 |
Correct |
20 ms |
1884 KB |
Output is correct |
4 |
Correct |
33 ms |
2788 KB |
Output is correct |
5 |
Correct |
20 ms |
1628 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
31 ms |
1628 KB |
Output is correct |
2 |
Correct |
38 ms |
1372 KB |
Output is correct |
3 |
Correct |
33 ms |
2648 KB |
Output is correct |
4 |
Correct |
36 ms |
2908 KB |
Output is correct |
5 |
Correct |
36 ms |
3216 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
27 ms |
1628 KB |
Output is correct |
2 |
Correct |
27 ms |
1624 KB |
Output is correct |
3 |
Correct |
31 ms |
2652 KB |
Output is correct |
4 |
Correct |
43 ms |
3932 KB |
Output is correct |
5 |
Correct |
37 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
28 ms |
1884 KB |
Output is correct |
2 |
Correct |
32 ms |
3420 KB |
Output is correct |
3 |
Correct |
35 ms |
2920 KB |
Output is correct |
4 |
Correct |
48 ms |
3932 KB |
Output is correct |
5 |
Correct |
42 ms |
3160 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
35 ms |
1884 KB |
Output is correct |
2 |
Correct |
32 ms |
3420 KB |
Output is correct |
3 |
Correct |
34 ms |
2904 KB |
Output is correct |
4 |
Correct |
45 ms |
4184 KB |
Output is correct |
5 |
Correct |
43 ms |
3164 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
139 ms |
8284 KB |
Output is correct |
2 |
Correct |
192 ms |
15812 KB |
Output is correct |
3 |
Correct |
169 ms |
15300 KB |
Output is correct |
4 |
Correct |
228 ms |
17728 KB |
Output is correct |
5 |
Correct |
210 ms |
14924 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
138 ms |
8284 KB |
Output is correct |
2 |
Correct |
277 ms |
14784 KB |
Output is correct |
3 |
Correct |
178 ms |
14032 KB |
Output is correct |
4 |
Correct |
220 ms |
17492 KB |
Output is correct |
5 |
Correct |
206 ms |
15568 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
174 ms |
9820 KB |
Output is correct |
2 |
Correct |
188 ms |
19036 KB |
Output is correct |
3 |
Correct |
204 ms |
18268 KB |
Output is correct |
4 |
Correct |
260 ms |
21600 KB |
Output is correct |
5 |
Correct |
241 ms |
17652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
194 ms |
9820 KB |
Output is correct |
2 |
Correct |
339 ms |
17632 KB |
Output is correct |
3 |
Correct |
200 ms |
16480 KB |
Output is correct |
4 |
Correct |
256 ms |
21344 KB |
Output is correct |
5 |
Correct |
250 ms |
18516 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
191 ms |
11356 KB |
Output is correct |
2 |
Correct |
222 ms |
22012 KB |
Output is correct |
3 |
Correct |
226 ms |
21396 KB |
Output is correct |
4 |
Correct |
308 ms |
24832 KB |
Output is correct |
5 |
Correct |
293 ms |
20244 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
212 ms |
11352 KB |
Output is correct |
2 |
Correct |
380 ms |
20480 KB |
Output is correct |
3 |
Correct |
250 ms |
19540 KB |
Output is correct |
4 |
Correct |
311 ms |
24844 KB |
Output is correct |
5 |
Correct |
280 ms |
21376 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
228 ms |
12888 KB |
Output is correct |
2 |
Correct |
256 ms |
25168 KB |
Output is correct |
3 |
Correct |
271 ms |
24404 KB |
Output is correct |
4 |
Correct |
385 ms |
28444 KB |
Output is correct |
5 |
Correct |
329 ms |
23892 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
229 ms |
12888 KB |
Output is correct |
2 |
Correct |
421 ms |
23320 KB |
Output is correct |
3 |
Correct |
288 ms |
22448 KB |
Output is correct |
4 |
Correct |
347 ms |
28336 KB |
Output is correct |
5 |
Correct |
334 ms |
24400 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
276 ms |
15964 KB |
Output is correct |
2 |
Correct |
336 ms |
31836 KB |
Output is correct |
3 |
Correct |
314 ms |
30544 KB |
Output is correct |
4 |
Correct |
428 ms |
35100 KB |
Output is correct |
5 |
Correct |
427 ms |
29692 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
274 ms |
15964 KB |
Output is correct |
2 |
Correct |
525 ms |
29268 KB |
Output is correct |
3 |
Correct |
354 ms |
28380 KB |
Output is correct |
4 |
Correct |
450 ms |
35308 KB |
Output is correct |
5 |
Correct |
431 ms |
30824 KB |
Output is correct |