#include<bits/stdc++.h>
#define int ll
#define forn(i,n) for(int i=0;i<(n);i++)
#define Forn(i,n) for(int i=1;i<=(n);i++)
#define ll long long
#define pb push_back
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define vi vector<int>
#define vl vector<long long>
#define vpi vector<pair<int,int> >
#define pii pair<int,int>
#define pll pair<long long,long long>
#define mp make_pair
#define rz resize
#define all(p) p.begin(),p.end()
#define alr(p,q) p+1,p+q+1
#define ull unsigned long long
#define st0(p) memset((p),0,sizeof(p))
#define T(x) ((x)%2 ? s[(x)/2] : '.')
#define lowb(x) x&-x
#define ls(x) (x)*2
#define rs(x) (x)*2+1
using namespace std;
inline void USACO(string filename){
freopen((filename+".in").c_str(),"r",stdin);
freopen((filename+".out").c_str(),"w",stdout);
}
void debug() {cout << endl;}
template <class T, class ...U> void debug(T a, U ... b) { cout << a << " "; debug(b...);}
// template <class T> int max(T a, T ... b) { cout << a << " "; debug(b...);}
const int INF = 1e9+7;
const double eps = 1e-7;
const int N = 8e2+9;
int n;
#define double long double
#define pdd pair<double,double>
int L;
vector<pdd> p;
bool check(double R){
vector<pdd> vs;
double cur = 0;
for(auto &i : p){
double dy = abs(i.S);
if(dy - R > eps) continue;
double d = sqrt(R*R - dy*dy);
double l = i.F -d,r = i.F +d;
if(l <= cur) cur = max(cur,(double)r);
}
return cur >= L;
}
void solve(){
cin >> n >> L;
p.rz(n);
forn(i,n) cin >> p[i].F >> p[i].S;
sort(all(p));
double lo = 0,hi = 1e9;
while(hi - lo > 1e-3){
double mid = (lo+hi)/2;
if(check(mid)) hi = mid;
else lo = mid;
}
// debug(check((double)10));
cout << hi << '\n';
}
signed main(){
// USACO("angry");
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(0);
cout << fixed << setprecision(4);
// int t;
// cin >> t;
// while(t--)
solve();
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
316 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
332 KB |
Output is correct |
2 |
Correct |
2 ms |
332 KB |
Output is correct |
3 |
Correct |
2 ms |
332 KB |
Output is correct |
4 |
Correct |
3 ms |
332 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
460 KB |
Output is correct |
2 |
Correct |
5 ms |
460 KB |
Output is correct |
3 |
Correct |
4 ms |
460 KB |
Output is correct |
4 |
Correct |
5 ms |
460 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
460 KB |
Output is correct |
2 |
Correct |
6 ms |
460 KB |
Output is correct |
3 |
Correct |
4 ms |
460 KB |
Output is correct |
4 |
Correct |
5 ms |
460 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
452 KB |
Output is correct |
2 |
Correct |
5 ms |
460 KB |
Output is correct |
3 |
Correct |
4 ms |
460 KB |
Output is correct |
4 |
Correct |
5 ms |
460 KB |
Output is correct |
5 |
Correct |
4 ms |
460 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
80 ms |
3132 KB |
Output is correct |
2 |
Correct |
87 ms |
3376 KB |
Output is correct |
3 |
Correct |
41 ms |
2276 KB |
Output is correct |
4 |
Correct |
58 ms |
3344 KB |
Output is correct |
5 |
Correct |
36 ms |
2264 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
76 ms |
3140 KB |
Output is correct |
2 |
Correct |
60 ms |
2944 KB |
Output is correct |
3 |
Correct |
64 ms |
3524 KB |
Output is correct |
4 |
Correct |
57 ms |
3552 KB |
Output is correct |
5 |
Correct |
65 ms |
3776 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
63 ms |
3404 KB |
Output is correct |
2 |
Correct |
70 ms |
3552 KB |
Output is correct |
3 |
Correct |
66 ms |
3604 KB |
Output is correct |
4 |
Correct |
95 ms |
4180 KB |
Output is correct |
5 |
Correct |
68 ms |
3688 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
85 ms |
4108 KB |
Output is correct |
2 |
Correct |
91 ms |
3864 KB |
Output is correct |
3 |
Correct |
98 ms |
3756 KB |
Output is correct |
4 |
Correct |
85 ms |
3836 KB |
Output is correct |
5 |
Correct |
72 ms |
3912 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
92 ms |
4140 KB |
Output is correct |
2 |
Correct |
88 ms |
4140 KB |
Output is correct |
3 |
Correct |
103 ms |
4160 KB |
Output is correct |
4 |
Correct |
86 ms |
4104 KB |
Output is correct |
5 |
Correct |
72 ms |
4164 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
389 ms |
16940 KB |
Output is correct |
2 |
Correct |
478 ms |
16764 KB |
Output is correct |
3 |
Correct |
452 ms |
16856 KB |
Output is correct |
4 |
Correct |
400 ms |
16836 KB |
Output is correct |
5 |
Correct |
393 ms |
16836 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
457 ms |
16992 KB |
Output is correct |
2 |
Correct |
427 ms |
16736 KB |
Output is correct |
3 |
Correct |
397 ms |
16820 KB |
Output is correct |
4 |
Correct |
397 ms |
16848 KB |
Output is correct |
5 |
Correct |
372 ms |
16736 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
481 ms |
20024 KB |
Output is correct |
2 |
Correct |
567 ms |
19904 KB |
Output is correct |
3 |
Correct |
585 ms |
20112 KB |
Output is correct |
4 |
Correct |
470 ms |
19872 KB |
Output is correct |
5 |
Correct |
447 ms |
19884 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
524 ms |
20212 KB |
Output is correct |
2 |
Correct |
515 ms |
20060 KB |
Output is correct |
3 |
Correct |
447 ms |
19880 KB |
Output is correct |
4 |
Correct |
471 ms |
19876 KB |
Output is correct |
5 |
Correct |
438 ms |
20036 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
546 ms |
23248 KB |
Output is correct |
2 |
Correct |
635 ms |
23004 KB |
Output is correct |
3 |
Correct |
603 ms |
23068 KB |
Output is correct |
4 |
Correct |
555 ms |
23184 KB |
Output is correct |
5 |
Correct |
520 ms |
23108 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
663 ms |
23248 KB |
Output is correct |
2 |
Correct |
608 ms |
23068 KB |
Output is correct |
3 |
Correct |
530 ms |
23196 KB |
Output is correct |
4 |
Correct |
567 ms |
23108 KB |
Output is correct |
5 |
Correct |
519 ms |
23236 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
632 ms |
26360 KB |
Output is correct |
2 |
Correct |
704 ms |
26272 KB |
Output is correct |
3 |
Correct |
691 ms |
26340 KB |
Output is correct |
4 |
Correct |
620 ms |
26300 KB |
Output is correct |
5 |
Correct |
595 ms |
26304 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
705 ms |
26376 KB |
Output is correct |
2 |
Correct |
672 ms |
26144 KB |
Output is correct |
3 |
Correct |
595 ms |
26180 KB |
Output is correct |
4 |
Correct |
628 ms |
26132 KB |
Output is correct |
5 |
Correct |
592 ms |
26216 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
784 ms |
32624 KB |
Output is correct |
2 |
Correct |
898 ms |
32128 KB |
Output is correct |
3 |
Correct |
867 ms |
32068 KB |
Output is correct |
4 |
Correct |
782 ms |
32108 KB |
Output is correct |
5 |
Correct |
733 ms |
32056 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
866 ms |
32824 KB |
Output is correct |
2 |
Correct |
848 ms |
33044 KB |
Output is correct |
3 |
Correct |
797 ms |
43976 KB |
Output is correct |
4 |
Correct |
775 ms |
33220 KB |
Output is correct |
5 |
Correct |
771 ms |
46328 KB |
Output is correct |