#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int MX = 1e6 + 5;
int n;
ld l;
pair<ll, ll> ar[MX];
bool check (ld mid) {
ld fins = 0;
for (int i = 0; i < n; i++) {
ld x, y;
tie(x, y) = ar[i];
ld delta = sqrt(mid * mid - y * y);
if (x - delta <= fins) fins = max(fins, x + delta);
}
if (fins >= l) return true;
else return false;
}
int main () {
cin >> n >> l;
for (int i = 0; i < n; i++) {
cin >> ar[i].first >> ar[i].second;
}
ld hi = 1.5e9, lo = 1;
while (hi - lo > 1e-3) {
ld mid = (lo + hi)/2;
if (check(mid)) {
hi = mid;
} else {
lo = mid;
}
}
cout << fixed << setprecision(4) << lo << '\n';
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
364 KB |
Output is correct |
2 |
Correct |
3 ms |
364 KB |
Output is correct |
3 |
Correct |
3 ms |
364 KB |
Output is correct |
4 |
Correct |
3 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
492 KB |
Output is correct |
2 |
Correct |
5 ms |
492 KB |
Output is correct |
3 |
Correct |
5 ms |
492 KB |
Output is correct |
4 |
Correct |
9 ms |
492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
492 KB |
Output is correct |
2 |
Correct |
5 ms |
492 KB |
Output is correct |
3 |
Correct |
5 ms |
492 KB |
Output is correct |
4 |
Correct |
9 ms |
492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
492 KB |
Output is correct |
2 |
Correct |
5 ms |
492 KB |
Output is correct |
3 |
Correct |
5 ms |
492 KB |
Output is correct |
4 |
Correct |
9 ms |
492 KB |
Output is correct |
5 |
Correct |
7 ms |
492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
93 ms |
1644 KB |
Output is correct |
2 |
Correct |
72 ms |
1644 KB |
Output is correct |
3 |
Correct |
57 ms |
1260 KB |
Output is correct |
4 |
Correct |
135 ms |
1644 KB |
Output is correct |
5 |
Correct |
61 ms |
1260 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
117 ms |
1644 KB |
Output is correct |
2 |
Correct |
105 ms |
1516 KB |
Output is correct |
3 |
Correct |
135 ms |
1848 KB |
Output is correct |
4 |
Correct |
141 ms |
1644 KB |
Output is correct |
5 |
Correct |
164 ms |
1868 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
69 ms |
1772 KB |
Output is correct |
2 |
Correct |
82 ms |
1800 KB |
Output is correct |
3 |
Correct |
90 ms |
1900 KB |
Output is correct |
4 |
Correct |
206 ms |
2028 KB |
Output is correct |
5 |
Correct |
126 ms |
2028 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
101 ms |
2028 KB |
Output is correct |
2 |
Correct |
96 ms |
2028 KB |
Output is correct |
3 |
Correct |
105 ms |
2156 KB |
Output is correct |
4 |
Correct |
210 ms |
2028 KB |
Output is correct |
5 |
Correct |
162 ms |
2028 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
104 ms |
2156 KB |
Output is correct |
2 |
Correct |
95 ms |
2284 KB |
Output is correct |
3 |
Correct |
101 ms |
2124 KB |
Output is correct |
4 |
Correct |
207 ms |
2156 KB |
Output is correct |
5 |
Correct |
160 ms |
2156 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
410 ms |
9068 KB |
Output is correct |
2 |
Correct |
481 ms |
8556 KB |
Output is correct |
3 |
Correct |
475 ms |
8684 KB |
Output is correct |
4 |
Execution timed out |
1057 ms |
8556 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
502 ms |
9044 KB |
Output is correct |
2 |
Correct |
680 ms |
8556 KB |
Output is correct |
3 |
Correct |
527 ms |
8684 KB |
Output is correct |
4 |
Execution timed out |
1008 ms |
8812 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
487 ms |
10548 KB |
Output is correct |
2 |
Correct |
583 ms |
10092 KB |
Output is correct |
3 |
Correct |
572 ms |
10096 KB |
Output is correct |
4 |
Execution timed out |
1095 ms |
10220 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
597 ms |
10476 KB |
Output is correct |
2 |
Correct |
825 ms |
17792 KB |
Output is correct |
3 |
Correct |
632 ms |
16620 KB |
Output is correct |
4 |
Execution timed out |
1046 ms |
21612 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
572 ms |
12196 KB |
Output is correct |
2 |
Correct |
687 ms |
11884 KB |
Output is correct |
3 |
Correct |
674 ms |
21612 KB |
Output is correct |
4 |
Execution timed out |
1096 ms |
24812 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
723 ms |
12012 KB |
Output is correct |
2 |
Correct |
970 ms |
20676 KB |
Output is correct |
3 |
Correct |
759 ms |
19692 KB |
Output is correct |
4 |
Execution timed out |
1059 ms |
24684 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
655 ms |
13676 KB |
Output is correct |
2 |
Correct |
793 ms |
25580 KB |
Output is correct |
3 |
Correct |
765 ms |
24812 KB |
Output is correct |
4 |
Execution timed out |
1032 ms |
28780 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
816 ms |
13672 KB |
Output is correct |
2 |
Execution timed out |
1089 ms |
23660 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
817 ms |
16748 KB |
Output is correct |
2 |
Correct |
1000 ms |
31700 KB |
Output is correct |
3 |
Correct |
966 ms |
30784 KB |
Output is correct |
4 |
Execution timed out |
1094 ms |
35308 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1008 ms |
18156 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |