#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<string>
#include<fstream>
#include<algorithm>
#include <iomanip>
#include<map>
#include <set>
#include <unordered_map>
#include <stack>
#include <unordered_set>
#include <cmath>
#define ll long long
#define For(i, n) for(int i = 0; i < (int)n; i++)
#define ffor(i, a, n) for(int i = (int)a; i < (int)n; i++)
#define rfor(i, n) for(int i = (int)n; i >= (int)0; i--)
#define rffor(i, a, n) for(int i = (int)n; i >= (int)a; i--)
#define vec vector
#define ff first
#define ss second
#define pb push_back
#define shit short int
#define pii pair<long double, long double>
#define NEK 2147483640
#define mod 1000000007
#define mod2 1000000009
#define rsz resize
#define prv1 43
#define prv2 47
#define D 8
using namespace std;
int main() {
long double n, asd;
cin >> n >> asd;
vec<pii> p;
For(i, n) {
long double x, y;
cin >> x >> y;
x *= 10000; y *= 10000;
if (p.size() > 0) {
if (x == p.back().ff && y > 0 && p.back().ss > 0) continue;
if (x == p.back().ff && y < 0) p.pop_back();
}
p.push_back({ x, y });
}
ll l = 0;
ll r = 14142135700000;
asd *= 10000;
while (l < r) {
long double mid = (l + r) / 2;
long double k = 0;
For(i, p.size()) {
long double jeden = mid * mid;
long double dva = p[i].second * p[i].second;
long double tri = jeden - dva;
long double d = sqrt(tri);
long double s = p[i].ff - d;
long double e = p[i].ff + d;
if (s > k) continue;
k = max(k, e);
}
if (k >= asd) r = mid;
else l = mid + 1;
}
cout << fixed << setprecision(5);
long double l2 = l;
l2 /= 10000;
cout << l2 << '\n';
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
604 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 |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 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 |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
604 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
604 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
600 KB |
Output is correct |
2 |
Correct |
4 ms |
860 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
7 ms |
860 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
588 KB |
Output is correct |
2 |
Correct |
4 ms |
1116 KB |
Output is correct |
3 |
Correct |
3 ms |
508 KB |
Output is correct |
4 |
Correct |
8 ms |
772 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
856 KB |
Output is correct |
2 |
Correct |
5 ms |
860 KB |
Output is correct |
3 |
Correct |
5 ms |
348 KB |
Output is correct |
4 |
Correct |
8 ms |
860 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
86 ms |
5416 KB |
Output is correct |
2 |
Correct |
59 ms |
3308 KB |
Output is correct |
3 |
Correct |
52 ms |
3016 KB |
Output is correct |
4 |
Correct |
111 ms |
5828 KB |
Output is correct |
5 |
Correct |
21 ms |
860 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
42 ms |
1744 KB |
Output is correct |
2 |
Correct |
70 ms |
3280 KB |
Output is correct |
3 |
Correct |
104 ms |
5512 KB |
Output is correct |
4 |
Correct |
118 ms |
5608 KB |
Output is correct |
5 |
Correct |
139 ms |
5824 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
84 ms |
5308 KB |
Output is correct |
2 |
Correct |
85 ms |
3404 KB |
Output is correct |
3 |
Correct |
71 ms |
5572 KB |
Output is correct |
4 |
Correct |
168 ms |
6176 KB |
Output is correct |
5 |
Correct |
66 ms |
2328 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
69 ms |
3776 KB |
Output is correct |
2 |
Correct |
68 ms |
3784 KB |
Output is correct |
3 |
Correct |
53 ms |
1992 KB |
Output is correct |
4 |
Correct |
166 ms |
6076 KB |
Output is correct |
5 |
Correct |
123 ms |
5564 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
89 ms |
5784 KB |
Output is correct |
2 |
Correct |
72 ms |
3784 KB |
Output is correct |
3 |
Correct |
62 ms |
1992 KB |
Output is correct |
4 |
Correct |
166 ms |
6080 KB |
Output is correct |
5 |
Correct |
126 ms |
5652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
372 ms |
20372 KB |
Output is correct |
2 |
Correct |
301 ms |
8400 KB |
Output is correct |
3 |
Correct |
299 ms |
7888 KB |
Output is correct |
4 |
Correct |
835 ms |
25492 KB |
Output is correct |
5 |
Correct |
621 ms |
21672 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
309 ms |
9052 KB |
Output is correct |
2 |
Correct |
622 ms |
22420 KB |
Output is correct |
3 |
Correct |
297 ms |
9144 KB |
Output is correct |
4 |
Correct |
862 ms |
25384 KB |
Output is correct |
5 |
Correct |
762 ms |
22672 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
439 ms |
37876 KB |
Output is correct |
2 |
Correct |
385 ms |
9932 KB |
Output is correct |
3 |
Correct |
356 ms |
9164 KB |
Output is correct |
4 |
Execution timed out |
1056 ms |
43620 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
383 ms |
10448 KB |
Output is correct |
2 |
Correct |
752 ms |
40324 KB |
Output is correct |
3 |
Correct |
322 ms |
11316 KB |
Output is correct |
4 |
Execution timed out |
1042 ms |
43488 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
478 ms |
38036 KB |
Output is correct |
2 |
Correct |
436 ms |
11448 KB |
Output is correct |
3 |
Correct |
419 ms |
10632 KB |
Output is correct |
4 |
Execution timed out |
1024 ms |
43636 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
484 ms |
11784 KB |
Output is correct |
2 |
Correct |
929 ms |
40352 KB |
Output is correct |
3 |
Correct |
428 ms |
12600 KB |
Output is correct |
4 |
Execution timed out |
1004 ms |
43412 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
597 ms |
38040 KB |
Output is correct |
2 |
Correct |
503 ms |
12532 KB |
Output is correct |
3 |
Correct |
481 ms |
12016 KB |
Output is correct |
4 |
Execution timed out |
1057 ms |
43672 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
484 ms |
13316 KB |
Output is correct |
2 |
Correct |
987 ms |
40340 KB |
Output is correct |
3 |
Correct |
484 ms |
13756 KB |
Output is correct |
4 |
Execution timed out |
1020 ms |
43668 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
772 ms |
40248 KB |
Output is correct |
2 |
Correct |
614 ms |
15788 KB |
Output is correct |
3 |
Correct |
599 ms |
13632 KB |
Output is correct |
4 |
Execution timed out |
1039 ms |
48928 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
683 ms |
15312 KB |
Output is correct |
2 |
Execution timed out |
1066 ms |
43128 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |