Submission #464205

# Submission time Handle Problem Language Result Execution time Memory
464205 2021-08-12T13:44:24 Z dqk Mobile (BOI12_mobile) C++17
100 / 100
876 ms 55616 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;
        }
    }
    printf("%.6lF\n", lo);
    return 0;
}

# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 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 2 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 588 KB Output is correct
2 Correct 3 ms 588 KB Output is correct
3 Correct 3 ms 460 KB Output is correct
4 Correct 4 ms 588 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 588 KB Output is correct
2 Correct 3 ms 588 KB Output is correct
3 Correct 4 ms 588 KB Output is correct
4 Correct 4 ms 588 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 588 KB Output is correct
2 Correct 3 ms 460 KB Output is correct
3 Correct 3 ms 588 KB Output is correct
4 Correct 6 ms 584 KB Output is correct
5 Correct 5 ms 588 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 64 ms 4400 KB Output is correct
2 Correct 49 ms 4428 KB Output is correct
3 Correct 32 ms 3148 KB Output is correct
4 Correct 58 ms 4364 KB Output is correct
5 Correct 32 ms 3068 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 54 ms 4580 KB Output is correct
2 Correct 51 ms 4172 KB Output is correct
3 Correct 58 ms 4684 KB Output is correct
4 Correct 61 ms 4656 KB Output is correct
5 Correct 69 ms 4940 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 48 ms 5112 KB Output is correct
2 Correct 50 ms 4828 KB Output is correct
3 Correct 51 ms 4940 KB Output is correct
4 Correct 83 ms 5756 KB Output is correct
5 Correct 65 ms 5188 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 61 ms 5784 KB Output is correct
2 Correct 60 ms 5708 KB Output is correct
3 Correct 63 ms 5776 KB Output is correct
4 Correct 84 ms 5784 KB Output is correct
5 Correct 72 ms 5780 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 63 ms 5708 KB Output is correct
2 Correct 60 ms 5792 KB Output is correct
3 Correct 73 ms 5780 KB Output is correct
4 Correct 80 ms 5780 KB Output is correct
5 Correct 74 ms 5784 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 290 ms 27800 KB Output is correct
2 Correct 314 ms 27716 KB Output is correct
3 Correct 323 ms 27708 KB Output is correct
4 Correct 405 ms 27708 KB Output is correct
5 Correct 383 ms 27724 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 316 ms 27696 KB Output is correct
2 Correct 434 ms 27692 KB Output is correct
3 Correct 321 ms 27696 KB Output is correct
4 Correct 407 ms 27704 KB Output is correct
5 Correct 389 ms 27716 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 351 ms 33180 KB Output is correct
2 Correct 380 ms 33184 KB Output is correct
3 Correct 374 ms 33184 KB Output is correct
4 Correct 502 ms 33180 KB Output is correct
5 Correct 475 ms 33180 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 385 ms 33184 KB Output is correct
2 Correct 537 ms 33096 KB Output is correct
3 Correct 376 ms 33180 KB Output is correct
4 Correct 499 ms 33184 KB Output is correct
5 Correct 461 ms 33220 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 450 ms 38660 KB Output is correct
2 Correct 449 ms 38664 KB Output is correct
3 Correct 438 ms 38596 KB Output is correct
4 Correct 598 ms 38720 KB Output is correct
5 Correct 544 ms 38664 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 461 ms 38664 KB Output is correct
2 Correct 607 ms 38660 KB Output is correct
3 Correct 457 ms 38668 KB Output is correct
4 Correct 579 ms 38660 KB Output is correct
5 Correct 559 ms 38660 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 487 ms 44160 KB Output is correct
2 Correct 523 ms 44136 KB Output is correct
3 Correct 534 ms 44404 KB Output is correct
4 Correct 681 ms 44392 KB Output is correct
5 Correct 611 ms 44396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 528 ms 44652 KB Output is correct
2 Correct 703 ms 44620 KB Output is correct
3 Correct 519 ms 44536 KB Output is correct
4 Correct 666 ms 44612 KB Output is correct
5 Correct 615 ms 44524 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 599 ms 55616 KB Output is correct
2 Correct 666 ms 55492 KB Output is correct
3 Correct 623 ms 55364 KB Output is correct
4 Correct 848 ms 55144 KB Output is correct
5 Correct 780 ms 55360 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 660 ms 55204 KB Output is correct
2 Correct 876 ms 55352 KB Output is correct
3 Correct 649 ms 55236 KB Output is correct
4 Correct 845 ms 55128 KB Output is correct
5 Correct 807 ms 55364 KB Output is correct