#include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
using ll = long long;
pair<ll, ll> p[1000000];
int main() {
cin.tie(0)->sync_with_stdio(0);
int n, len;
cin >> n >> len;
for (int i = 0; i < n; i++) cin >> p[i].x >> p[i].y;
double l = 1, r = 1.5e9;
while (r - l > 1e-3) {
double mid = (l + r) / 2, curr = 0;
for (int i = 0; i < n; i++) {
double delta = sqrt(mid * mid - p[i].y * p[i].y);
double a = p[i].x - delta, b = p[i].x + delta;
if (a <= curr) curr = max(curr, b);
}
if (curr >= len) r = mid;
else l = mid;
}
cout << fixed << setprecision(4) << l;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 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 |
344 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 |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
600 KB |
Output is correct |
4 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
2 ms |
600 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
344 KB |
Output is correct |
5 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
2652 KB |
Output is correct |
2 |
Correct |
18 ms |
2648 KB |
Output is correct |
3 |
Correct |
13 ms |
2648 KB |
Output is correct |
4 |
Correct |
23 ms |
2652 KB |
Output is correct |
5 |
Correct |
14 ms |
2696 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
2652 KB |
Output is correct |
2 |
Correct |
20 ms |
2696 KB |
Output is correct |
3 |
Correct |
25 ms |
2692 KB |
Output is correct |
4 |
Correct |
24 ms |
2652 KB |
Output is correct |
5 |
Correct |
27 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
19 ms |
2648 KB |
Output is correct |
2 |
Correct |
20 ms |
2684 KB |
Output is correct |
3 |
Correct |
20 ms |
2648 KB |
Output is correct |
4 |
Correct |
38 ms |
2652 KB |
Output is correct |
5 |
Correct |
27 ms |
2648 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
2904 KB |
Output is correct |
2 |
Correct |
23 ms |
2652 KB |
Output is correct |
3 |
Correct |
23 ms |
2648 KB |
Output is correct |
4 |
Correct |
32 ms |
2648 KB |
Output is correct |
5 |
Correct |
27 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
27 ms |
2652 KB |
Output is correct |
2 |
Correct |
29 ms |
2652 KB |
Output is correct |
3 |
Correct |
23 ms |
2648 KB |
Output is correct |
4 |
Correct |
37 ms |
2676 KB |
Output is correct |
5 |
Correct |
29 ms |
2648 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
114 ms |
8784 KB |
Output is correct |
2 |
Correct |
122 ms |
8828 KB |
Output is correct |
3 |
Correct |
119 ms |
8828 KB |
Output is correct |
4 |
Correct |
157 ms |
8824 KB |
Output is correct |
5 |
Correct |
151 ms |
8784 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
123 ms |
8576 KB |
Output is correct |
2 |
Correct |
183 ms |
9044 KB |
Output is correct |
3 |
Correct |
126 ms |
8784 KB |
Output is correct |
4 |
Correct |
151 ms |
8784 KB |
Output is correct |
5 |
Correct |
140 ms |
8788 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
143 ms |
10884 KB |
Output is correct |
2 |
Correct |
142 ms |
10888 KB |
Output is correct |
3 |
Correct |
142 ms |
10876 KB |
Output is correct |
4 |
Correct |
202 ms |
10880 KB |
Output is correct |
5 |
Correct |
169 ms |
10876 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
144 ms |
10876 KB |
Output is correct |
2 |
Correct |
223 ms |
10836 KB |
Output is correct |
3 |
Correct |
135 ms |
10836 KB |
Output is correct |
4 |
Correct |
199 ms |
10880 KB |
Output is correct |
5 |
Correct |
166 ms |
10884 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
145 ms |
12884 KB |
Output is correct |
2 |
Correct |
170 ms |
12888 KB |
Output is correct |
3 |
Correct |
162 ms |
12884 KB |
Output is correct |
4 |
Correct |
216 ms |
12880 KB |
Output is correct |
5 |
Correct |
191 ms |
12916 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
170 ms |
12932 KB |
Output is correct |
2 |
Correct |
238 ms |
12880 KB |
Output is correct |
3 |
Correct |
162 ms |
12880 KB |
Output is correct |
4 |
Correct |
215 ms |
12912 KB |
Output is correct |
5 |
Correct |
226 ms |
12924 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
164 ms |
14984 KB |
Output is correct |
2 |
Correct |
188 ms |
14972 KB |
Output is correct |
3 |
Correct |
187 ms |
15184 KB |
Output is correct |
4 |
Correct |
283 ms |
15184 KB |
Output is correct |
5 |
Correct |
223 ms |
14980 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
191 ms |
14980 KB |
Output is correct |
2 |
Correct |
274 ms |
14980 KB |
Output is correct |
3 |
Correct |
181 ms |
14932 KB |
Output is correct |
4 |
Correct |
261 ms |
14980 KB |
Output is correct |
5 |
Correct |
223 ms |
14980 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
224 ms |
16008 KB |
Output is correct |
2 |
Correct |
249 ms |
16088 KB |
Output is correct |
3 |
Correct |
260 ms |
16088 KB |
Output is correct |
4 |
Correct |
316 ms |
15956 KB |
Output is correct |
5 |
Correct |
290 ms |
28600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
240 ms |
15988 KB |
Output is correct |
2 |
Correct |
326 ms |
15956 KB |
Output is correct |
3 |
Correct |
236 ms |
16088 KB |
Output is correct |
4 |
Correct |
310 ms |
16208 KB |
Output is correct |
5 |
Correct |
286 ms |
29400 KB |
Output is correct |