# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
732496 |
2023-04-29T05:02:38 Z |
uy842003 |
Mobile (BOI12_mobile) |
C++17 |
|
1000 ms |
25088 KB |
#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-4;
inline bool cmp_less(const double &a, const double &b) {
return a + eps < b;
}
inline bool cmp_equal(const double &a, const double &b) {
return abs(a - b) < eps;
}
inline bool cmp_less_equal(const double &a, const double &b) {
return cmp_less(a, b) || cmp_equal(a, b);
}
int main() {
int n;
double len;
cin >> n >> len;
vector<pair<double, double>> cor(n);
for (int i = 0; i < n; i++)
cin >> cor[i].first >> cor[i].second;
double l = 0, r = 1e10, m;
while (cmp_less(l, r)) {
m = (l + r) / 2;
double cur_pos = 0;
for (int i = 0; i < n; i++) {
if (!cmp_less_equal(m, abs(cor[i].second))) {
double dx = sqrt(m * m - cor[i].second * cor[i].second);
if (cmp_less_equal(cor[i].first - dx, cur_pos)) cur_pos = max(cur_pos, cor[i].first + dx);
}
}
if (cmp_less_equal(len, cur_pos))
r = m;
else
l = m + eps;
}
cout << setprecision(3) << fixed << r << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
296 KB |
Output is correct |
4 |
Correct |
1 ms |
296 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
300 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
360 KB |
Output is correct |
2 |
Correct |
4 ms |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
316 KB |
Output is correct |
4 |
Correct |
4 ms |
364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
312 KB |
Output is correct |
2 |
Correct |
9 ms |
440 KB |
Output is correct |
3 |
Correct |
6 ms |
312 KB |
Output is correct |
4 |
Correct |
10 ms |
452 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
312 KB |
Output is correct |
2 |
Correct |
7 ms |
444 KB |
Output is correct |
3 |
Correct |
5 ms |
312 KB |
Output is correct |
4 |
Correct |
7 ms |
444 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
340 KB |
Output is correct |
2 |
Correct |
7 ms |
436 KB |
Output is correct |
3 |
Correct |
5 ms |
340 KB |
Output is correct |
4 |
Correct |
9 ms |
456 KB |
Output is correct |
5 |
Correct |
6 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
90 ms |
1644 KB |
Output is correct |
2 |
Correct |
112 ms |
1580 KB |
Output is correct |
3 |
Correct |
60 ms |
1260 KB |
Output is correct |
4 |
Correct |
97 ms |
1504 KB |
Output is correct |
5 |
Correct |
43 ms |
1308 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
72 ms |
1644 KB |
Output is correct |
2 |
Correct |
77 ms |
1452 KB |
Output is correct |
3 |
Correct |
88 ms |
1576 KB |
Output is correct |
4 |
Correct |
94 ms |
1656 KB |
Output is correct |
5 |
Correct |
103 ms |
1848 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
80 ms |
1740 KB |
Output is correct |
2 |
Correct |
99 ms |
1616 KB |
Output is correct |
3 |
Correct |
89 ms |
1648 KB |
Output is correct |
4 |
Correct |
142 ms |
1972 KB |
Output is correct |
5 |
Correct |
89 ms |
1808 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
129 ms |
1996 KB |
Output is correct |
2 |
Correct |
119 ms |
1876 KB |
Output is correct |
3 |
Correct |
97 ms |
2084 KB |
Output is correct |
4 |
Correct |
155 ms |
1996 KB |
Output is correct |
5 |
Correct |
102 ms |
1980 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
126 ms |
1932 KB |
Output is correct |
2 |
Correct |
120 ms |
1972 KB |
Output is correct |
3 |
Correct |
98 ms |
1992 KB |
Output is correct |
4 |
Correct |
130 ms |
1980 KB |
Output is correct |
5 |
Correct |
110 ms |
2084 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
469 ms |
8360 KB |
Output is correct |
2 |
Correct |
660 ms |
8276 KB |
Output is correct |
3 |
Correct |
590 ms |
15272 KB |
Output is correct |
4 |
Correct |
643 ms |
17576 KB |
Output is correct |
5 |
Correct |
554 ms |
14932 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
613 ms |
8376 KB |
Output is correct |
2 |
Correct |
631 ms |
14668 KB |
Output is correct |
3 |
Correct |
564 ms |
13860 KB |
Output is correct |
4 |
Correct |
642 ms |
17448 KB |
Output is correct |
5 |
Correct |
567 ms |
15400 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
563 ms |
9984 KB |
Output is correct |
2 |
Correct |
795 ms |
18952 KB |
Output is correct |
3 |
Correct |
699 ms |
18376 KB |
Output is correct |
4 |
Correct |
818 ms |
21556 KB |
Output is correct |
5 |
Correct |
653 ms |
17656 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
755 ms |
9948 KB |
Output is correct |
2 |
Correct |
701 ms |
17600 KB |
Output is correct |
3 |
Correct |
617 ms |
16508 KB |
Output is correct |
4 |
Correct |
784 ms |
21312 KB |
Output is correct |
5 |
Correct |
696 ms |
18368 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
666 ms |
11504 KB |
Output is correct |
2 |
Correct |
882 ms |
22084 KB |
Output is correct |
3 |
Correct |
862 ms |
21348 KB |
Output is correct |
4 |
Correct |
911 ms |
24676 KB |
Output is correct |
5 |
Correct |
744 ms |
20192 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
882 ms |
11504 KB |
Output is correct |
2 |
Correct |
845 ms |
20444 KB |
Output is correct |
3 |
Correct |
739 ms |
19620 KB |
Output is correct |
4 |
Correct |
990 ms |
24612 KB |
Output is correct |
5 |
Correct |
895 ms |
21348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
802 ms |
13072 KB |
Output is correct |
2 |
Execution timed out |
1054 ms |
25088 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1095 ms |
13204 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1010 ms |
16260 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1002 ms |
16184 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |