# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
464196 |
2021-08-12T13:39:15 Z |
dqk |
Mobile (BOI12_mobile) |
C++17 |
|
834 ms |
55108 KB |
#include <bits/stdc++.h>
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
int n;
double L;
std::cin >> n >> L;
std::vector<std::vector<int>> p(n, std::vector<int>(2, 0));
for (int i = 0; i < n; ++i) {
std::cin >> p[i][0] >> p[i][1];
}
sort(p.begin(), p.end());
double lo = 0.0, hi = 3e9;
while(hi - lo > 1e-6) {
double mi = lo + (hi - lo) / 2;
double cur = 0.0;
for (int i = 0; i < n; ++i) {
double d = sqrt(mi * mi - 1ll * p[i][1] * p[i][1]);
if (cur >= p[i][0] - d)
cur = std::max(cur, p[i][0] + d);
}
if (cur >= L) {
hi = mi;
}
else {
lo = mi;
}
}
std::cout << std::setprecision(10) << lo << "\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
460 KB |
Output is correct |
2 |
Correct |
2 ms |
460 KB |
Output is correct |
3 |
Correct |
2 ms |
332 KB |
Output is correct |
4 |
Correct |
3 ms |
332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
460 KB |
Output is correct |
2 |
Correct |
3 ms |
460 KB |
Output is correct |
3 |
Correct |
3 ms |
460 KB |
Output is correct |
4 |
Correct |
4 ms |
460 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
560 KB |
Output is correct |
2 |
Correct |
4 ms |
460 KB |
Output is correct |
3 |
Correct |
3 ms |
460 KB |
Output is correct |
4 |
Correct |
4 ms |
580 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
460 KB |
Output is correct |
2 |
Correct |
3 ms |
460 KB |
Output is correct |
3 |
Correct |
3 ms |
460 KB |
Output is correct |
4 |
Correct |
4 ms |
460 KB |
Output is correct |
5 |
Correct |
5 ms |
588 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
62 ms |
4300 KB |
Output is correct |
2 |
Correct |
48 ms |
4428 KB |
Output is correct |
3 |
Correct |
37 ms |
3148 KB |
Output is correct |
4 |
Correct |
56 ms |
4428 KB |
Output is correct |
5 |
Correct |
32 ms |
3020 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
53 ms |
4504 KB |
Output is correct |
2 |
Correct |
52 ms |
4056 KB |
Output is correct |
3 |
Correct |
63 ms |
4676 KB |
Output is correct |
4 |
Correct |
58 ms |
4556 KB |
Output is correct |
5 |
Correct |
70 ms |
4940 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
5068 KB |
Output is correct |
2 |
Correct |
49 ms |
4724 KB |
Output is correct |
3 |
Correct |
51 ms |
4940 KB |
Output is correct |
4 |
Correct |
91 ms |
5708 KB |
Output is correct |
5 |
Correct |
62 ms |
5196 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
64 ms |
5704 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
60 ms |
5708 KB |
Output is correct |
2 |
Correct |
59 ms |
5708 KB |
Output is correct |
3 |
Correct |
65 ms |
5708 KB |
Output is correct |
4 |
Correct |
80 ms |
5708 KB |
Output is correct |
5 |
Correct |
76 ms |
5708 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
309 ms |
27712 KB |
Output is correct |
2 |
Incorrect |
308 ms |
27584 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
340 ms |
27712 KB |
Output is correct |
2 |
Correct |
449 ms |
27596 KB |
Output is correct |
3 |
Correct |
315 ms |
27592 KB |
Output is correct |
4 |
Correct |
404 ms |
27592 KB |
Output is correct |
5 |
Correct |
390 ms |
27576 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
375 ms |
33112 KB |
Output is correct |
2 |
Incorrect |
379 ms |
33068 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
376 ms |
33092 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
403 ms |
38532 KB |
Output is correct |
2 |
Incorrect |
434 ms |
38620 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
440 ms |
38636 KB |
Output is correct |
2 |
Correct |
599 ms |
38592 KB |
Output is correct |
3 |
Correct |
473 ms |
38624 KB |
Output is correct |
4 |
Correct |
571 ms |
38604 KB |
Output is correct |
5 |
Correct |
531 ms |
38644 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
493 ms |
44124 KB |
Output is correct |
2 |
Incorrect |
506 ms |
44112 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
504 ms |
44100 KB |
Output is correct |
2 |
Correct |
698 ms |
44068 KB |
Output is correct |
3 |
Correct |
524 ms |
44012 KB |
Output is correct |
4 |
Correct |
678 ms |
44100 KB |
Output is correct |
5 |
Correct |
625 ms |
44100 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
572 ms |
54984 KB |
Output is correct |
2 |
Incorrect |
629 ms |
55108 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
639 ms |
54976 KB |
Output is correct |
2 |
Correct |
834 ms |
54980 KB |
Output is correct |
3 |
Correct |
638 ms |
54976 KB |
Output is correct |
4 |
Correct |
821 ms |
54980 KB |
Output is correct |
5 |
Correct |
768 ms |
55108 KB |
Output is correct |