#include<bits/stdc++.h>
using namespace std;
int n;
double L, x[1000100], y[1000100], l = 0, r = 1e9;
vector<pair<double, double>> vc;
bool solve(double mid){
vc.clear();
double ans = 0;
for(int i=1; i<=n; i++) {
int dis = sqrt(mid*mid - y[i]*y[i]);
vc.emplace_back(x[i] - dis, x[i] + dis);
}
for(auto i: vc) if(i.first <= ans) ans = max(ans, i.second);
if(ans >= L) return 1;
else return 0;
}
int main(){
cin.tie(nullptr)->sync_with_stdio(false);
cin >> n >> L;
for(int i = 1; i<=n; ++i){
cin >> x[i] >> y[i];
}
while(l+0.0001 < r){
double mid = (l + r) / 2.0;
if(solve(mid)) r = mid;
else l = mid + 0.0001;
}
cout << fixed << setprecision(6) << l;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2396 KB |
Output is correct |
4 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
2648 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
2652 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
2652 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
2652 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
49 ms |
9620 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
43 ms |
9408 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
49 ms |
9420 KB |
Output is correct |
2 |
Correct |
44 ms |
9680 KB |
Output is correct |
3 |
Correct |
43 ms |
9984 KB |
Output is correct |
4 |
Incorrect |
64 ms |
10200 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
55 ms |
9936 KB |
Output is correct |
2 |
Correct |
54 ms |
9788 KB |
Output is correct |
3 |
Correct |
51 ms |
9676 KB |
Output is correct |
4 |
Incorrect |
76 ms |
10224 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
67 ms |
9932 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
247 ms |
21656 KB |
Output is correct |
2 |
Correct |
368 ms |
23616 KB |
Output is correct |
3 |
Correct |
268 ms |
24004 KB |
Output is correct |
4 |
Incorrect |
321 ms |
25444 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
281 ms |
25544 KB |
Output is correct |
2 |
Incorrect |
356 ms |
23240 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
326 ms |
35480 KB |
Output is correct |
2 |
Correct |
369 ms |
38348 KB |
Output is correct |
3 |
Correct |
349 ms |
37060 KB |
Output is correct |
4 |
Incorrect |
396 ms |
39416 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
345 ms |
37824 KB |
Output is correct |
2 |
Incorrect |
443 ms |
36084 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
378 ms |
34912 KB |
Output is correct |
2 |
Correct |
379 ms |
37376 KB |
Output is correct |
3 |
Correct |
386 ms |
38632 KB |
Output is correct |
4 |
Incorrect |
449 ms |
40156 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
380 ms |
37476 KB |
Output is correct |
2 |
Incorrect |
503 ms |
37848 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
436 ms |
35708 KB |
Output is correct |
2 |
Correct |
437 ms |
39404 KB |
Output is correct |
3 |
Correct |
443 ms |
38964 KB |
Output is correct |
4 |
Incorrect |
545 ms |
40196 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
458 ms |
40652 KB |
Output is correct |
2 |
Incorrect |
554 ms |
37572 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
489 ms |
37316 KB |
Output is correct |
2 |
Correct |
567 ms |
42616 KB |
Output is correct |
3 |
Correct |
567 ms |
41344 KB |
Output is correct |
4 |
Incorrect |
660 ms |
44024 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
581 ms |
41500 KB |
Output is correct |
2 |
Incorrect |
694 ms |
41672 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |