#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 = 1e10;
while(hi - lo > 1e-7){
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 |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
312 KB |
Output is correct |
4 |
Correct |
1 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 |
296 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
332 KB |
Output is correct |
2 |
Correct |
3 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 |
5 ms |
460 KB |
Output is correct |
2 |
Correct |
5 ms |
460 KB |
Output is correct |
3 |
Correct |
5 ms |
452 KB |
Output is correct |
4 |
Correct |
5 ms |
448 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
460 KB |
Output is correct |
2 |
Correct |
5 ms |
460 KB |
Output is correct |
3 |
Correct |
5 ms |
512 KB |
Output is correct |
4 |
Correct |
6 ms |
460 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
452 KB |
Output is correct |
2 |
Correct |
6 ms |
460 KB |
Output is correct |
3 |
Correct |
7 ms |
460 KB |
Output is correct |
4 |
Correct |
4 ms |
456 KB |
Output is correct |
5 |
Correct |
5 ms |
460 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
75 ms |
2764 KB |
Output is correct |
2 |
Correct |
74 ms |
2764 KB |
Output is correct |
3 |
Correct |
46 ms |
2504 KB |
Output is correct |
4 |
Correct |
59 ms |
3824 KB |
Output is correct |
5 |
Correct |
42 ms |
2260 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
57 ms |
2892 KB |
Output is correct |
2 |
Correct |
52 ms |
2636 KB |
Output is correct |
3 |
Correct |
60 ms |
2892 KB |
Output is correct |
4 |
Correct |
63 ms |
2904 KB |
Output is correct |
5 |
Correct |
72 ms |
3148 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
76 ms |
3148 KB |
Output is correct |
2 |
Correct |
75 ms |
3020 KB |
Output is correct |
3 |
Correct |
74 ms |
3852 KB |
Output is correct |
4 |
Correct |
83 ms |
5332 KB |
Output is correct |
5 |
Correct |
66 ms |
3992 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
97 ms |
3532 KB |
Output is correct |
2 |
Correct |
93 ms |
4804 KB |
Output is correct |
3 |
Correct |
84 ms |
4472 KB |
Output is correct |
4 |
Correct |
84 ms |
5352 KB |
Output is correct |
5 |
Correct |
79 ms |
4588 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
100 ms |
3532 KB |
Output is correct |
2 |
Correct |
93 ms |
3532 KB |
Output is correct |
3 |
Correct |
91 ms |
4452 KB |
Output is correct |
4 |
Correct |
102 ms |
5308 KB |
Output is correct |
5 |
Correct |
77 ms |
4724 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
460 ms |
16360 KB |
Output is correct |
2 |
Correct |
497 ms |
18400 KB |
Output is correct |
3 |
Correct |
477 ms |
18372 KB |
Output is correct |
4 |
Correct |
429 ms |
18392 KB |
Output is correct |
5 |
Correct |
403 ms |
18340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
511 ms |
16240 KB |
Output is correct |
2 |
Correct |
534 ms |
18392 KB |
Output is correct |
3 |
Correct |
418 ms |
18500 KB |
Output is correct |
4 |
Correct |
427 ms |
18280 KB |
Output is correct |
5 |
Correct |
388 ms |
18292 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
523 ms |
19396 KB |
Output is correct |
2 |
Correct |
618 ms |
21488 KB |
Output is correct |
3 |
Correct |
573 ms |
21572 KB |
Output is correct |
4 |
Correct |
522 ms |
21528 KB |
Output is correct |
5 |
Correct |
491 ms |
21440 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
597 ms |
19400 KB |
Output is correct |
2 |
Correct |
630 ms |
21640 KB |
Output is correct |
3 |
Correct |
515 ms |
21444 KB |
Output is correct |
4 |
Correct |
516 ms |
21532 KB |
Output is correct |
5 |
Correct |
515 ms |
21516 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
625 ms |
22652 KB |
Output is correct |
2 |
Correct |
700 ms |
24644 KB |
Output is correct |
3 |
Correct |
688 ms |
24656 KB |
Output is correct |
4 |
Correct |
610 ms |
24388 KB |
Output is correct |
5 |
Correct |
554 ms |
24392 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
695 ms |
22516 KB |
Output is correct |
2 |
Correct |
725 ms |
24268 KB |
Output is correct |
3 |
Correct |
584 ms |
24132 KB |
Output is correct |
4 |
Correct |
600 ms |
24108 KB |
Output is correct |
5 |
Correct |
556 ms |
24132 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
684 ms |
25716 KB |
Output is correct |
2 |
Correct |
763 ms |
27248 KB |
Output is correct |
3 |
Correct |
782 ms |
26984 KB |
Output is correct |
4 |
Correct |
682 ms |
26948 KB |
Output is correct |
5 |
Correct |
632 ms |
26692 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
811 ms |
25756 KB |
Output is correct |
2 |
Correct |
801 ms |
26728 KB |
Output is correct |
3 |
Correct |
694 ms |
26640 KB |
Output is correct |
4 |
Correct |
679 ms |
26500 KB |
Output is correct |
5 |
Correct |
640 ms |
26504 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
909 ms |
32164 KB |
Output is correct |
2 |
Execution timed out |
1002 ms |
47100 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
992 ms |
32172 KB |
Output is correct |
2 |
Execution timed out |
1008 ms |
44792 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |