#include <bits/stdc++.h>
using namespace std;
int main() {
int n, sz;
cin >> n >> sz;
vector<pair<long long, long long>> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i].first >> a[i].second;
}
double l = 1, r = 2e9;
while (r - l > 1e-3) {
double mid = (l + r) / 2, j = 0;
vector<pair<int, int>> s;
for (int i = 0; i < n; i++) {
double temp = sqrt(mid * mid - a[i].second * a[i].second);
double left = a[i].first - temp, right = a[i].first + temp;
s.push_back({left, right});
if (left <= j) j = max(j, right);
}
if (j >= sz) r = mid;
else l = mid;
}
cout << fixed << setprecision(6) << l << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 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 |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 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 |
# |
Verdict |
Execution time |
Memory |
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 |
524 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
604 KB |
Output is correct |
2 |
Correct |
4 ms |
604 KB |
Output is correct |
3 |
Correct |
3 ms |
604 KB |
Output is correct |
4 |
Correct |
4 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
604 KB |
Output is correct |
2 |
Correct |
4 ms |
604 KB |
Output is correct |
3 |
Correct |
4 ms |
604 KB |
Output is correct |
4 |
Correct |
5 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
604 KB |
Output is correct |
2 |
Correct |
4 ms |
512 KB |
Output is correct |
3 |
Correct |
3 ms |
604 KB |
Output is correct |
4 |
Correct |
4 ms |
604 KB |
Output is correct |
5 |
Correct |
4 ms |
600 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
68 ms |
3288 KB |
Output is correct |
2 |
Correct |
73 ms |
3308 KB |
Output is correct |
3 |
Correct |
44 ms |
2824 KB |
Output is correct |
4 |
Correct |
76 ms |
4456 KB |
Output is correct |
5 |
Correct |
37 ms |
2632 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
65 ms |
3368 KB |
Output is correct |
2 |
Correct |
63 ms |
3224 KB |
Output is correct |
3 |
Correct |
76 ms |
3300 KB |
Output is correct |
4 |
Correct |
83 ms |
4616 KB |
Output is correct |
5 |
Correct |
88 ms |
5072 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
59 ms |
3580 KB |
Output is correct |
2 |
Correct |
88 ms |
3440 KB |
Output is correct |
3 |
Correct |
72 ms |
4408 KB |
Output is correct |
4 |
Correct |
96 ms |
5788 KB |
Output is correct |
5 |
Correct |
73 ms |
4768 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
88 ms |
3904 KB |
Output is correct |
2 |
Correct |
87 ms |
3844 KB |
Output is correct |
3 |
Correct |
97 ms |
4892 KB |
Output is correct |
4 |
Correct |
106 ms |
5924 KB |
Output is correct |
5 |
Correct |
86 ms |
5132 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
90 ms |
3788 KB |
Output is correct |
2 |
Correct |
88 ms |
3868 KB |
Output is correct |
3 |
Correct |
81 ms |
4884 KB |
Output is correct |
4 |
Correct |
102 ms |
5828 KB |
Output is correct |
5 |
Correct |
93 ms |
5124 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
358 ms |
16356 KB |
Output is correct |
2 |
Correct |
405 ms |
16304 KB |
Output is correct |
3 |
Correct |
430 ms |
23636 KB |
Output is correct |
4 |
Correct |
484 ms |
25892 KB |
Output is correct |
5 |
Correct |
424 ms |
23140 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
448 ms |
16328 KB |
Output is correct |
2 |
Correct |
440 ms |
22964 KB |
Output is correct |
3 |
Correct |
361 ms |
22696 KB |
Output is correct |
4 |
Correct |
482 ms |
25808 KB |
Output is correct |
5 |
Correct |
452 ms |
23740 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
525 ms |
24216 KB |
Output is correct |
2 |
Correct |
538 ms |
23472 KB |
Output is correct |
3 |
Correct |
573 ms |
32828 KB |
Output is correct |
4 |
Correct |
604 ms |
35688 KB |
Output is correct |
5 |
Correct |
529 ms |
31664 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
577 ms |
24004 KB |
Output is correct |
2 |
Correct |
571 ms |
32176 KB |
Output is correct |
3 |
Correct |
491 ms |
30836 KB |
Output is correct |
4 |
Correct |
564 ms |
35924 KB |
Output is correct |
5 |
Correct |
527 ms |
33924 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
538 ms |
26380 KB |
Output is correct |
2 |
Correct |
606 ms |
26980 KB |
Output is correct |
3 |
Correct |
611 ms |
37292 KB |
Output is correct |
4 |
Correct |
673 ms |
40088 KB |
Output is correct |
5 |
Correct |
614 ms |
34464 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
645 ms |
27064 KB |
Output is correct |
2 |
Correct |
693 ms |
36336 KB |
Output is correct |
3 |
Correct |
581 ms |
34188 KB |
Output is correct |
4 |
Correct |
758 ms |
38888 KB |
Output is correct |
5 |
Correct |
652 ms |
36668 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
575 ms |
28336 KB |
Output is correct |
2 |
Correct |
673 ms |
27604 KB |
Output is correct |
3 |
Correct |
688 ms |
40100 KB |
Output is correct |
4 |
Correct |
799 ms |
43480 KB |
Output is correct |
5 |
Correct |
685 ms |
39368 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
700 ms |
28668 KB |
Output is correct |
2 |
Correct |
740 ms |
39860 KB |
Output is correct |
3 |
Correct |
685 ms |
37544 KB |
Output is correct |
4 |
Correct |
743 ms |
43244 KB |
Output is correct |
5 |
Correct |
728 ms |
40372 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
689 ms |
32552 KB |
Output is correct |
2 |
Correct |
857 ms |
32132 KB |
Output is correct |
3 |
Correct |
840 ms |
46720 KB |
Output is correct |
4 |
Correct |
927 ms |
51708 KB |
Output is correct |
5 |
Correct |
841 ms |
45740 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
860 ms |
32176 KB |
Output is correct |
2 |
Correct |
822 ms |
45356 KB |
Output is correct |
3 |
Correct |
798 ms |
44448 KB |
Output is correct |
4 |
Correct |
955 ms |
51528 KB |
Output is correct |
5 |
Correct |
892 ms |
46964 KB |
Output is correct |