#include <bits/stdc++.h>
#define int long long
#define sz(x) (int)(x.size())
using namespace std;
int n, L;
vector<pair<double, double>> a;
long double dist(long double x1, pair<long double, long double> other) {
long double y1=0;
long double x2=other.first, y2=other.second;
return ((long double)sqrt((long double)((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))));
}
void solve() {
cin >> n >> L;
a.clear();
a.resize(n);
for (auto &u: a) cin >> u.first >> u.second;
double l=0, r=1e9;
while (r-l>=0.001) {
double mid=(l+r)/2;
double borne=0;
for (int i=0; i<n; i++) {
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 |
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 |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
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 |
2 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
348 KB |
Output is correct |
2 |
Correct |
3 ms |
348 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
3 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
348 KB |
Output is correct |
2 |
Correct |
3 ms |
536 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
3 ms |
348 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
39 ms |
1628 KB |
Output is correct |
2 |
Correct |
36 ms |
1796 KB |
Output is correct |
3 |
Correct |
25 ms |
1112 KB |
Output is correct |
4 |
Correct |
43 ms |
1624 KB |
Output is correct |
5 |
Correct |
22 ms |
1252 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
44 ms |
1624 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
35 ms |
1844 KB |
Output is correct |
2 |
Correct |
38 ms |
1744 KB |
Output is correct |
3 |
Correct |
38 ms |
1796 KB |
Output is correct |
4 |
Correct |
58 ms |
1884 KB |
Output is correct |
5 |
Correct |
44 ms |
1628 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
56 ms |
1880 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
46 ms |
2012 KB |
Output is correct |
2 |
Correct |
48 ms |
2008 KB |
Output is correct |
3 |
Incorrect |
44 ms |
1884 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
209 ms |
8280 KB |
Output is correct |
2 |
Correct |
234 ms |
8288 KB |
Output is correct |
3 |
Correct |
224 ms |
8284 KB |
Output is correct |
4 |
Incorrect |
272 ms |
8528 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
242 ms |
8284 KB |
Output is correct |
2 |
Correct |
292 ms |
8284 KB |
Output is correct |
3 |
Correct |
215 ms |
8284 KB |
Output is correct |
4 |
Correct |
283 ms |
8284 KB |
Output is correct |
5 |
Correct |
263 ms |
8284 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
255 ms |
9836 KB |
Output is correct |
2 |
Correct |
273 ms |
9820 KB |
Output is correct |
3 |
Correct |
287 ms |
9844 KB |
Output is correct |
4 |
Correct |
330 ms |
9816 KB |
Output is correct |
5 |
Correct |
317 ms |
10064 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
294 ms |
9820 KB |
Output is correct |
2 |
Correct |
339 ms |
9836 KB |
Output is correct |
3 |
Correct |
260 ms |
9832 KB |
Output is correct |
4 |
Correct |
334 ms |
9840 KB |
Output is correct |
5 |
Correct |
323 ms |
9840 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
284 ms |
11404 KB |
Output is correct |
2 |
Correct |
315 ms |
11400 KB |
Output is correct |
3 |
Correct |
336 ms |
11404 KB |
Output is correct |
4 |
Incorrect |
412 ms |
11404 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
328 ms |
11608 KB |
Output is correct |
2 |
Incorrect |
398 ms |
11356 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
346 ms |
12972 KB |
Output is correct |
2 |
Incorrect |
362 ms |
12892 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
380 ms |
12888 KB |
Output is correct |
2 |
Correct |
451 ms |
12972 KB |
Output is correct |
3 |
Correct |
345 ms |
12972 KB |
Output is correct |
4 |
Correct |
440 ms |
12976 KB |
Output is correct |
5 |
Correct |
436 ms |
12972 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
403 ms |
16104 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
470 ms |
16104 KB |
Output is correct |
2 |
Correct |
553 ms |
16108 KB |
Output is correct |
3 |
Correct |
444 ms |
16212 KB |
Output is correct |
4 |
Correct |
546 ms |
16100 KB |
Output is correct |
5 |
Correct |
516 ms |
16100 KB |
Output is correct |