#include <bits/stdc++.h>
#define sz(x) (int)(x.size())
using namespace std;
int n, L;
vector<pair<double, double>> a;
void solve() {
cin >> n >> L;
a.clear();
for (int i=0; i<n; i++) {
int x, y; cin >> x >> y;
if (!a.empty() && x==a.back().first) {
if (abs(y)<abs(a.back().second)) a.back().second=y;
continue;
}
a.push_back({x, y});
}
n=sz(a);
double l=0, r=1e9;
while (r-l>0.000999999) {
double mid=(l+r)/2;
double borne=0;
for (int i=0; i<n; i++) {
if (abs(a[i].second)>mid) continue;
double x=a[i].first, y=a[i].second;
double dist=sqrt((double)(mid*mid-y*y));
if (x-dist<=borne && x+dist>borne) borne=x+dist;
}
if (borne>=L) r=mid;
else l=mid;
}
cout << fixed << setprecision(3) << l << endl;
return;
}
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
solve();
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 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 |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 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 |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
600 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
604 KB |
Output is correct |
2 |
Correct |
2 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
2 ms |
604 KB |
Output is correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
2516 KB |
Output is correct |
2 |
Correct |
18 ms |
1496 KB |
Output is correct |
3 |
Correct |
13 ms |
1604 KB |
Output is correct |
4 |
Correct |
22 ms |
2520 KB |
Output is correct |
5 |
Correct |
6 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
10 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
23 ms |
2516 KB |
Output is correct |
2 |
Correct |
19 ms |
1500 KB |
Output is correct |
3 |
Correct |
20 ms |
2520 KB |
Output is correct |
4 |
Correct |
26 ms |
2772 KB |
Output is correct |
5 |
Correct |
13 ms |
1084 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
19 ms |
1500 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
2520 KB |
Output is correct |
2 |
Correct |
19 ms |
1548 KB |
Output is correct |
3 |
Incorrect |
13 ms |
828 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
116 ms |
8924 KB |
Output is correct |
2 |
Correct |
66 ms |
592 KB |
Output is correct |
3 |
Correct |
64 ms |
816 KB |
Output is correct |
4 |
Incorrect |
107 ms |
8896 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
68 ms |
668 KB |
Output is correct |
2 |
Correct |
159 ms |
9156 KB |
Output is correct |
3 |
Correct |
80 ms |
2508 KB |
Output is correct |
4 |
Correct |
106 ms |
9416 KB |
Output is correct |
5 |
Correct |
102 ms |
9664 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
139 ms |
17848 KB |
Output is correct |
2 |
Correct |
78 ms |
680 KB |
Output is correct |
3 |
Correct |
81 ms |
596 KB |
Output is correct |
4 |
Correct |
132 ms |
17996 KB |
Output is correct |
5 |
Correct |
106 ms |
9404 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
80 ms |
572 KB |
Output is correct |
2 |
Correct |
189 ms |
18312 KB |
Output is correct |
3 |
Correct |
73 ms |
2512 KB |
Output is correct |
4 |
Correct |
134 ms |
18208 KB |
Output is correct |
5 |
Correct |
122 ms |
17844 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
172 ms |
18616 KB |
Output is correct |
2 |
Correct |
89 ms |
592 KB |
Output is correct |
3 |
Correct |
85 ms |
648 KB |
Output is correct |
4 |
Incorrect |
154 ms |
17592 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
92 ms |
560 KB |
Output is correct |
2 |
Incorrect |
208 ms |
18616 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
195 ms |
18888 KB |
Output is correct |
2 |
Incorrect |
100 ms |
544 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
105 ms |
596 KB |
Output is correct |
2 |
Correct |
231 ms |
17596 KB |
Output is correct |
3 |
Correct |
102 ms |
2504 KB |
Output is correct |
4 |
Correct |
176 ms |
18008 KB |
Output is correct |
5 |
Correct |
159 ms |
17340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
244 ms |
18104 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
135 ms |
556 KB |
Output is correct |
2 |
Correct |
289 ms |
18360 KB |
Output is correct |
3 |
Correct |
133 ms |
6088 KB |
Output is correct |
4 |
Correct |
235 ms |
18720 KB |
Output is correct |
5 |
Correct |
205 ms |
17248 KB |
Output is correct |