#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using tiiii = tuple<int, int, ll, ll>;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
int n, L; cin >> n >> L;
vector < ll > x(n), y(n);
for (int i = 0; i < n; i++)
cin >> x[i] >> y[i];
auto Good = [&](double dist) {
double r = 0;
for (int i = 0; i < n; i++) {
if (y[i] > dist)
continue;
double left = x[i] - sqrt(dist * dist - y[i] * y[i]);
double right = x[i] + sqrt(dist * dist - y[i] * y[i]);
if (left <= r)
r = max(r, right);
}
return r >= L;
};
double l = 1, m, r = 2e+9;
while (r - l > 1e-3) {
m = (l + r) / 2;
if (Good(m))
r = m;
else
l = m;
}
cout << setprecision(4) << fixed << (l + r) / 2 << "\n";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 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 |
348 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 |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
3 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
3 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
344 KB |
Output is correct |
2 |
Correct |
2 ms |
536 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
3 ms |
344 KB |
Output is correct |
5 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
1628 KB |
Output is correct |
2 |
Correct |
20 ms |
1628 KB |
Output is correct |
3 |
Correct |
13 ms |
1812 KB |
Output is correct |
4 |
Correct |
42 ms |
2400 KB |
Output is correct |
5 |
Correct |
13 ms |
1624 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
1628 KB |
Output is correct |
2 |
Correct |
33 ms |
1368 KB |
Output is correct |
3 |
Correct |
40 ms |
1720 KB |
Output is correct |
4 |
Correct |
43 ms |
2396 KB |
Output is correct |
5 |
Correct |
50 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
1880 KB |
Output is correct |
2 |
Correct |
22 ms |
1752 KB |
Output is correct |
3 |
Correct |
19 ms |
2396 KB |
Output is correct |
4 |
Correct |
62 ms |
3164 KB |
Output is correct |
5 |
Correct |
36 ms |
2644 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
1884 KB |
Output is correct |
2 |
Correct |
25 ms |
1884 KB |
Output is correct |
3 |
Correct |
28 ms |
2648 KB |
Output is correct |
4 |
Correct |
64 ms |
3164 KB |
Output is correct |
5 |
Correct |
49 ms |
2648 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
25 ms |
1880 KB |
Output is correct |
2 |
Correct |
25 ms |
1884 KB |
Output is correct |
3 |
Correct |
22 ms |
2652 KB |
Output is correct |
4 |
Correct |
63 ms |
3292 KB |
Output is correct |
5 |
Correct |
48 ms |
2648 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
115 ms |
8280 KB |
Output is correct |
2 |
Correct |
126 ms |
8280 KB |
Output is correct |
3 |
Correct |
131 ms |
12372 KB |
Output is correct |
4 |
Correct |
306 ms |
13748 KB |
Output is correct |
5 |
Correct |
254 ms |
11856 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
124 ms |
8284 KB |
Output is correct |
2 |
Correct |
179 ms |
12116 KB |
Output is correct |
3 |
Correct |
109 ms |
11344 KB |
Output is correct |
4 |
Correct |
301 ms |
13136 KB |
Output is correct |
5 |
Correct |
263 ms |
12116 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
136 ms |
10068 KB |
Output is correct |
2 |
Correct |
150 ms |
9836 KB |
Output is correct |
3 |
Correct |
150 ms |
14556 KB |
Output is correct |
4 |
Correct |
369 ms |
15956 KB |
Output is correct |
5 |
Correct |
298 ms |
14196 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
148 ms |
9816 KB |
Output is correct |
2 |
Correct |
193 ms |
14164 KB |
Output is correct |
3 |
Correct |
139 ms |
13420 KB |
Output is correct |
4 |
Correct |
375 ms |
15952 KB |
Output is correct |
5 |
Correct |
319 ms |
14672 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
156 ms |
11352 KB |
Output is correct |
2 |
Correct |
172 ms |
11412 KB |
Output is correct |
3 |
Correct |
178 ms |
16792 KB |
Output is correct |
4 |
Correct |
427 ms |
18260 KB |
Output is correct |
5 |
Correct |
344 ms |
16272 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
176 ms |
11416 KB |
Output is correct |
2 |
Correct |
218 ms |
16716 KB |
Output is correct |
3 |
Correct |
153 ms |
15700 KB |
Output is correct |
4 |
Correct |
429 ms |
18320 KB |
Output is correct |
5 |
Correct |
361 ms |
16976 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
179 ms |
12888 KB |
Output is correct |
2 |
Correct |
202 ms |
12968 KB |
Output is correct |
3 |
Correct |
197 ms |
19028 KB |
Output is correct |
4 |
Correct |
500 ms |
21164 KB |
Output is correct |
5 |
Correct |
413 ms |
18856 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
202 ms |
12972 KB |
Output is correct |
2 |
Correct |
240 ms |
18864 KB |
Output is correct |
3 |
Correct |
175 ms |
18084 KB |
Output is correct |
4 |
Correct |
487 ms |
20904 KB |
Output is correct |
5 |
Correct |
420 ms |
22184 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
236 ms |
20968 KB |
Output is correct |
2 |
Correct |
255 ms |
24552 KB |
Output is correct |
3 |
Correct |
253 ms |
24248 KB |
Output is correct |
4 |
Correct |
608 ms |
26028 KB |
Output is correct |
5 |
Correct |
490 ms |
23016 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
271 ms |
24916 KB |
Output is correct |
2 |
Correct |
292 ms |
23136 KB |
Output is correct |
3 |
Correct |
226 ms |
22504 KB |
Output is correct |
4 |
Correct |
617 ms |
26088 KB |
Output is correct |
5 |
Correct |
523 ms |
23932 KB |
Output is correct |