# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
633261 |
2022-08-22T02:46:33 Z |
afatpotato |
Mobile (BOI12_mobile) |
C++14 |
|
1000 ms |
28436 KB |
#include <bits/stdc++.h>
using namespace std;
vector<pair<double, double> > tower;
long long n, l;
int main() {
cin >> n >> l;
tower.resize(n);
for (int i = 0; i < n; i++) {
cin >> tower[i].first >> tower[i].second;
}
sort(tower.begin(), tower.end());
double low = 0;
double high = 4e9;
double ans = 0;
while (high - low > 1e-3) {
double mid = (low + high) / 2;
double cur = 0;
for (int i = 0; i < n; i++) {
double delta = sqrt(mid * mid - tower[i].second * tower[i].second);
double a = tower[i].first - delta;
double b = tower[i].first + delta;
if (a <= cur) {
cur = max(cur, b);
}
}
if (cur > l) {
ans = mid;
high = mid;
} else {
low = mid;
}
}
cout << fixed;
cout << setprecision(9);
cout << ans << endl;
}
# |
Verdict |
Execution time |
Memory |
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 |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
212 KB |
Output is correct |
4 |
Correct |
3 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
340 KB |
Output is correct |
2 |
Correct |
6 ms |
372 KB |
Output is correct |
3 |
Correct |
4 ms |
340 KB |
Output is correct |
4 |
Correct |
7 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
340 KB |
Output is correct |
2 |
Correct |
6 ms |
340 KB |
Output is correct |
3 |
Correct |
5 ms |
340 KB |
Output is correct |
4 |
Correct |
6 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
340 KB |
Output is correct |
2 |
Correct |
5 ms |
340 KB |
Output is correct |
3 |
Correct |
5 ms |
340 KB |
Output is correct |
4 |
Correct |
6 ms |
340 KB |
Output is correct |
5 |
Correct |
5 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
80 ms |
1472 KB |
Output is correct |
2 |
Correct |
85 ms |
1492 KB |
Output is correct |
3 |
Correct |
52 ms |
1132 KB |
Output is correct |
4 |
Correct |
91 ms |
1468 KB |
Output is correct |
5 |
Correct |
43 ms |
980 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
79 ms |
1520 KB |
Output is correct |
2 |
Correct |
73 ms |
1396 KB |
Output is correct |
3 |
Correct |
91 ms |
1564 KB |
Output is correct |
4 |
Correct |
95 ms |
1492 KB |
Output is correct |
5 |
Correct |
110 ms |
1620 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
87 ms |
1660 KB |
Output is correct |
2 |
Correct |
94 ms |
1580 KB |
Output is correct |
3 |
Correct |
80 ms |
1620 KB |
Output is correct |
4 |
Correct |
139 ms |
1848 KB |
Output is correct |
5 |
Correct |
94 ms |
1684 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
111 ms |
1856 KB |
Output is correct |
2 |
Correct |
108 ms |
1852 KB |
Output is correct |
3 |
Correct |
92 ms |
1748 KB |
Output is correct |
4 |
Correct |
139 ms |
1860 KB |
Output is correct |
5 |
Correct |
118 ms |
1748 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
126 ms |
1856 KB |
Output is correct |
2 |
Correct |
105 ms |
1748 KB |
Output is correct |
3 |
Correct |
96 ms |
1856 KB |
Output is correct |
4 |
Correct |
149 ms |
1856 KB |
Output is correct |
5 |
Correct |
111 ms |
1852 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
436 ms |
8112 KB |
Output is correct |
2 |
Correct |
570 ms |
8112 KB |
Output is correct |
3 |
Correct |
537 ms |
8116 KB |
Output is correct |
4 |
Correct |
702 ms |
8148 KB |
Output is correct |
5 |
Correct |
558 ms |
8116 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
591 ms |
8116 KB |
Output is correct |
2 |
Correct |
652 ms |
8124 KB |
Output is correct |
3 |
Correct |
488 ms |
8132 KB |
Output is correct |
4 |
Correct |
716 ms |
8120 KB |
Output is correct |
5 |
Correct |
616 ms |
8020 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
564 ms |
9684 KB |
Output is correct |
2 |
Correct |
768 ms |
9684 KB |
Output is correct |
3 |
Correct |
686 ms |
9684 KB |
Output is correct |
4 |
Correct |
870 ms |
9688 KB |
Output is correct |
5 |
Correct |
671 ms |
9684 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
699 ms |
9684 KB |
Output is correct |
2 |
Correct |
737 ms |
9684 KB |
Output is correct |
3 |
Correct |
610 ms |
9684 KB |
Output is correct |
4 |
Correct |
837 ms |
9684 KB |
Output is correct |
5 |
Correct |
732 ms |
9684 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
607 ms |
11244 KB |
Output is correct |
2 |
Correct |
828 ms |
11248 KB |
Output is correct |
3 |
Correct |
761 ms |
11244 KB |
Output is correct |
4 |
Correct |
972 ms |
11256 KB |
Output is correct |
5 |
Correct |
781 ms |
20300 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
830 ms |
11252 KB |
Output is correct |
2 |
Correct |
833 ms |
11220 KB |
Output is correct |
3 |
Correct |
701 ms |
11248 KB |
Output is correct |
4 |
Correct |
959 ms |
11248 KB |
Output is correct |
5 |
Correct |
829 ms |
11252 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
720 ms |
12816 KB |
Output is correct |
2 |
Correct |
910 ms |
12812 KB |
Output is correct |
3 |
Correct |
958 ms |
24348 KB |
Output is correct |
4 |
Execution timed out |
1080 ms |
28436 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
950 ms |
12820 KB |
Output is correct |
2 |
Correct |
948 ms |
12876 KB |
Output is correct |
3 |
Correct |
795 ms |
12816 KB |
Output is correct |
4 |
Execution timed out |
1080 ms |
12756 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
880 ms |
15956 KB |
Output is correct |
2 |
Execution timed out |
1091 ms |
15956 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1097 ms |
15956 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |