#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;
}
else a.push_back({x, y});
}
n=sz(a);
double l=0, r=1e9;
while (r-l>0.0009) {
double mid=(l+r)/2;
double borne=0;
double popo=pow(mid, 2);
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(popo-pow(y, 2));
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 |
0 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 |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 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 |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
388 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 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 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
604 KB |
Output is correct |
2 |
Correct |
2 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
600 KB |
Output is correct |
5 |
Correct |
1 ms |
456 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
2520 KB |
Output is correct |
2 |
Correct |
18 ms |
1500 KB |
Output is correct |
3 |
Correct |
13 ms |
1500 KB |
Output is correct |
4 |
Correct |
18 ms |
2516 KB |
Output is correct |
5 |
Correct |
5 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
604 KB |
Output is correct |
2 |
Correct |
13 ms |
1500 KB |
Output is correct |
3 |
Correct |
17 ms |
2620 KB |
Output is correct |
4 |
Correct |
20 ms |
2516 KB |
Output is correct |
5 |
Correct |
20 ms |
2516 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
2520 KB |
Output is correct |
2 |
Correct |
21 ms |
1500 KB |
Output is correct |
3 |
Correct |
19 ms |
2520 KB |
Output is correct |
4 |
Correct |
24 ms |
2608 KB |
Output is correct |
5 |
Correct |
13 ms |
992 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
20 ms |
1500 KB |
Output is correct |
2 |
Correct |
19 ms |
1496 KB |
Output is correct |
3 |
Correct |
13 ms |
860 KB |
Output is correct |
4 |
Correct |
31 ms |
2520 KB |
Output is correct |
5 |
Correct |
29 ms |
2416 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
30 ms |
2516 KB |
Output is correct |
2 |
Correct |
22 ms |
1640 KB |
Output is correct |
3 |
Correct |
14 ms |
832 KB |
Output is correct |
4 |
Correct |
24 ms |
2520 KB |
Output is correct |
5 |
Correct |
22 ms |
2520 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
113 ms |
10692 KB |
Output is correct |
2 |
Correct |
67 ms |
804 KB |
Output is correct |
3 |
Correct |
62 ms |
668 KB |
Output is correct |
4 |
Correct |
124 ms |
9156 KB |
Output is correct |
5 |
Correct |
96 ms |
9860 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
71 ms |
820 KB |
Output is correct |
2 |
Correct |
163 ms |
8904 KB |
Output is correct |
3 |
Correct |
68 ms |
2512 KB |
Output is correct |
4 |
Correct |
113 ms |
9964 KB |
Output is correct |
5 |
Correct |
112 ms |
9912 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
159 ms |
17852 KB |
Output is correct |
2 |
Correct |
79 ms |
596 KB |
Output is correct |
3 |
Correct |
74 ms |
592 KB |
Output is correct |
4 |
Correct |
146 ms |
17032 KB |
Output is correct |
5 |
Correct |
109 ms |
8920 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
93 ms |
636 KB |
Output is correct |
2 |
Correct |
194 ms |
18104 KB |
Output is correct |
3 |
Correct |
77 ms |
2508 KB |
Output is correct |
4 |
Correct |
137 ms |
17796 KB |
Output is correct |
5 |
Correct |
134 ms |
18424 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
190 ms |
18764 KB |
Output is correct |
2 |
Correct |
109 ms |
492 KB |
Output is correct |
3 |
Correct |
107 ms |
544 KB |
Output is correct |
4 |
Correct |
160 ms |
18608 KB |
Output is correct |
5 |
Correct |
117 ms |
9492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
93 ms |
652 KB |
Output is correct |
2 |
Correct |
217 ms |
17300 KB |
Output is correct |
3 |
Correct |
109 ms |
2800 KB |
Output is correct |
4 |
Correct |
159 ms |
17968 KB |
Output is correct |
5 |
Correct |
164 ms |
17028 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
187 ms |
16824 KB |
Output is correct |
2 |
Correct |
100 ms |
492 KB |
Output is correct |
3 |
Correct |
98 ms |
628 KB |
Output is correct |
4 |
Correct |
198 ms |
18352 KB |
Output is correct |
5 |
Correct |
152 ms |
10924 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
106 ms |
596 KB |
Output is correct |
2 |
Correct |
242 ms |
17332 KB |
Output is correct |
3 |
Correct |
109 ms |
2660 KB |
Output is correct |
4 |
Correct |
181 ms |
18616 KB |
Output is correct |
5 |
Correct |
171 ms |
17748 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
236 ms |
17336 KB |
Output is correct |
2 |
Correct |
130 ms |
464 KB |
Output is correct |
3 |
Correct |
122 ms |
624 KB |
Output is correct |
4 |
Correct |
242 ms |
18876 KB |
Output is correct |
5 |
Correct |
177 ms |
10176 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
131 ms |
592 KB |
Output is correct |
2 |
Correct |
291 ms |
17848 KB |
Output is correct |
3 |
Correct |
130 ms |
6364 KB |
Output is correct |
4 |
Correct |
229 ms |
18104 KB |
Output is correct |
5 |
Correct |
202 ms |
17280 KB |
Output is correct |