Submission #464194

# Submission time Handle Problem Language Result Execution time Memory
464194 2021-08-12T13:37:16 Z dqk Mobile (BOI12_mobile) C++17
65 / 100
699 ms 56132 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];
        p[i][1] = abs(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 h = p[i][1];
            if (h > mi)
                continue;
            double d = sqrt(mi * mi - h * h);
            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 1 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 460 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 716 KB Output is correct
2 Correct 4 ms 580 KB Output is correct
3 Correct 3 ms 588 KB Output is correct
4 Correct 4 ms 588 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 588 KB Output is correct
2 Correct 4 ms 588 KB Output is correct
3 Correct 3 ms 588 KB Output is correct
4 Correct 3 ms 588 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 588 KB Output is correct
2 Correct 4 ms 588 KB Output is correct
3 Correct 3 ms 588 KB Output is correct
4 Correct 3 ms 588 KB Output is correct
5 Correct 3 ms 588 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 49 ms 5168 KB Output is correct
2 Correct 47 ms 4940 KB Output is correct
3 Correct 30 ms 3752 KB Output is correct
4 Correct 38 ms 5012 KB Output is correct
5 Correct 27 ms 3404 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 40 ms 5324 KB Output is correct
2 Correct 36 ms 4936 KB Output is correct
3 Correct 40 ms 5604 KB Output is correct
4 Correct 44 ms 5272 KB Output is correct
5 Correct 43 ms 5704 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 50 ms 5708 KB Output is correct
2 Correct 51 ms 5828 KB Output is correct
3 Correct 47 ms 5580 KB Output is correct
4 Correct 51 ms 6288 KB Output is correct
5 Correct 44 ms 5828 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 62 ms 6692 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 62 ms 6596 KB Output is correct
2 Correct 64 ms 6388 KB Output is correct
3 Correct 60 ms 6404 KB Output is correct
4 Correct 51 ms 6312 KB Output is correct
5 Correct 50 ms 6348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 298 ms 29204 KB Output is correct
2 Incorrect 315 ms 28224 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 322 ms 29168 KB Output is correct
2 Correct 360 ms 28356 KB Output is correct
3 Correct 290 ms 28240 KB Output is correct
4 Correct 292 ms 28228 KB Output is correct
5 Correct 285 ms 28332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 353 ms 34628 KB Output is correct
2 Incorrect 387 ms 33692 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 386 ms 34644 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 408 ms 40080 KB Output is correct
2 Incorrect 457 ms 39288 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 475 ms 40144 KB Output is correct
2 Correct 515 ms 39260 KB Output is correct
3 Correct 428 ms 39236 KB Output is correct
4 Correct 413 ms 39236 KB Output is correct
5 Correct 401 ms 39224 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 471 ms 45612 KB Output is correct
2 Incorrect 547 ms 44740 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 536 ms 45712 KB Output is correct
2 Correct 572 ms 44740 KB Output is correct
3 Correct 494 ms 44740 KB Output is correct
4 Correct 472 ms 44612 KB Output is correct
5 Correct 438 ms 44604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 623 ms 56132 KB Output is correct
2 Incorrect 699 ms 55496 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 662 ms 55116 KB Output is correct
2 Correct 676 ms 55472 KB Output is correct
3 Correct 593 ms 55364 KB Output is correct
4 Correct 567 ms 54996 KB Output is correct
5 Correct 582 ms 55284 KB Output is correct