#include "bits/stdc++.h"
using namespace std;
const int INF = 1e9 + 7;
int32_t main() {
cin.tie(0)->sync_with_stdio(0);
int n, L; cin >> n >> L;
vector<pair<int, int>> a(n);
for (auto &x: a) cin >> x.first >> x.second;
auto good = [&](double R) {
double l = 0;
for (auto i: a) {
long long u, v; tie(u, v) = i;
#define sqr(x) (x) * (x)
if (sqr(R) - sqr(v) < 0) continue;
double delta = sqrt(sqr(R) - sqr(v));
double x1 = -delta + u, x2 = delta + u;
if (x1 <= l) l = max(l, x2);
// cout << fixed << setprecision(10) << x1 << ' ' << x2 << '\n';
}
return l >= L;
};
double l = -1, r = 1e9 + 1;
for (int i = 1, ITER = 100; i <= ITER; ++i) {
double m = l + (r - l) / 2;
if (good(m)) r = m;
else l = m;
}
cout << fixed << setprecision(9) << r;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
2 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
340 KB |
Output is correct |
2 |
Correct |
3 ms |
340 KB |
Output is correct |
3 |
Correct |
3 ms |
340 KB |
Output is correct |
4 |
Correct |
2 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
340 KB |
Output is correct |
2 |
Correct |
4 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
4 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
3 ms |
340 KB |
Output is correct |
5 |
Correct |
2 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
57 ms |
852 KB |
Output is correct |
2 |
Correct |
35 ms |
852 KB |
Output is correct |
3 |
Correct |
21 ms |
724 KB |
Output is correct |
4 |
Correct |
24 ms |
852 KB |
Output is correct |
5 |
Correct |
14 ms |
724 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
23 ms |
852 KB |
Output is correct |
2 |
Correct |
22 ms |
852 KB |
Output is correct |
3 |
Correct |
25 ms |
852 KB |
Output is correct |
4 |
Correct |
27 ms |
852 KB |
Output is correct |
5 |
Correct |
40 ms |
980 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
42 ms |
980 KB |
Output is correct |
2 |
Correct |
35 ms |
852 KB |
Output is correct |
3 |
Correct |
32 ms |
980 KB |
Output is correct |
4 |
Correct |
32 ms |
1108 KB |
Output is correct |
5 |
Correct |
26 ms |
980 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
45 ms |
1108 KB |
Output is correct |
2 |
Correct |
47 ms |
1108 KB |
Output is correct |
3 |
Correct |
38 ms |
1108 KB |
Output is correct |
4 |
Correct |
33 ms |
1108 KB |
Output is correct |
5 |
Correct |
30 ms |
1108 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
44 ms |
1108 KB |
Output is correct |
2 |
Correct |
53 ms |
1108 KB |
Output is correct |
3 |
Correct |
38 ms |
1108 KB |
Output is correct |
4 |
Correct |
33 ms |
1108 KB |
Output is correct |
5 |
Correct |
30 ms |
1108 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
203 ms |
4180 KB |
Output is correct |
2 |
Correct |
230 ms |
4180 KB |
Output is correct |
3 |
Correct |
219 ms |
4180 KB |
Output is correct |
4 |
Correct |
165 ms |
4164 KB |
Output is correct |
5 |
Correct |
150 ms |
4180 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
219 ms |
4180 KB |
Output is correct |
2 |
Correct |
461 ms |
4180 KB |
Output is correct |
3 |
Correct |
178 ms |
4180 KB |
Output is correct |
4 |
Correct |
153 ms |
4180 KB |
Output is correct |
5 |
Correct |
156 ms |
4180 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
236 ms |
4948 KB |
Output is correct |
2 |
Correct |
282 ms |
7560 KB |
Output is correct |
3 |
Correct |
262 ms |
7440 KB |
Output is correct |
4 |
Correct |
197 ms |
7436 KB |
Output is correct |
5 |
Correct |
180 ms |
7372 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
261 ms |
4948 KB |
Output is correct |
2 |
Correct |
526 ms |
7348 KB |
Output is correct |
3 |
Correct |
223 ms |
7388 KB |
Output is correct |
4 |
Correct |
189 ms |
7364 KB |
Output is correct |
5 |
Correct |
227 ms |
13696 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
269 ms |
5716 KB |
Output is correct |
2 |
Correct |
309 ms |
8200 KB |
Output is correct |
3 |
Correct |
307 ms |
8216 KB |
Output is correct |
4 |
Correct |
224 ms |
8212 KB |
Output is correct |
5 |
Correct |
216 ms |
14736 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
310 ms |
5716 KB |
Output is correct |
2 |
Correct |
570 ms |
8012 KB |
Output is correct |
3 |
Correct |
256 ms |
7876 KB |
Output is correct |
4 |
Correct |
221 ms |
7936 KB |
Output is correct |
5 |
Correct |
211 ms |
7792 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
311 ms |
6484 KB |
Output is correct |
2 |
Correct |
349 ms |
8524 KB |
Output is correct |
3 |
Correct |
347 ms |
8616 KB |
Output is correct |
4 |
Correct |
266 ms |
8408 KB |
Output is correct |
5 |
Correct |
237 ms |
8400 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
362 ms |
6484 KB |
Output is correct |
2 |
Correct |
620 ms |
8464 KB |
Output is correct |
3 |
Correct |
309 ms |
16044 KB |
Output is correct |
4 |
Correct |
257 ms |
21932 KB |
Output is correct |
5 |
Correct |
253 ms |
18092 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
393 ms |
8148 KB |
Output is correct |
2 |
Correct |
440 ms |
9916 KB |
Output is correct |
3 |
Correct |
437 ms |
9840 KB |
Output is correct |
4 |
Correct |
316 ms |
11912 KB |
Output is correct |
5 |
Correct |
304 ms |
9792 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
459 ms |
8148 KB |
Output is correct |
2 |
Correct |
755 ms |
9752 KB |
Output is correct |
3 |
Correct |
382 ms |
9400 KB |
Output is correct |
4 |
Correct |
317 ms |
10664 KB |
Output is correct |
5 |
Correct |
305 ms |
9356 KB |
Output is correct |