Submission #464173

# Submission time Handle Problem Language Result Execution time Memory
464173 2021-08-12T13:27:21 Z dqk Mobile (BOI12_mobile) C++17
4 / 100
583 ms 54980 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 = 4e9;
    while(hi - lo > 1e-3) {
        double mi = (lo + hi) / 2;
        double cur = 0.0;
        for (int i = 0; i < n; ++i) {
            double h = 1.0 * 1ll * p[i][1];
            if (h > mi)
                continue;
            double d = sqrt(mi * mi - h * h);
            if (cur >= 1.0 * p[i][0] - d)
                cur = std::max(cur, 1.0 * p[i][0] + d);
        }
        bool ok = cur >= L;
        if (ok) {
            hi = mi;
        }
        else {
            lo = mi;
        }
    }
    std::cout << lo << "\n";
    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 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 Incorrect 0 ms 204 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 332 KB Output is correct
2 Correct 2 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Incorrect 2 ms 332 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 460 KB Output is correct
2 Incorrect 3 ms 460 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 460 KB Output is correct
2 Incorrect 3 ms 460 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 460 KB Output is correct
2 Incorrect 3 ms 580 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 42 ms 4312 KB Output is correct
2 Incorrect 42 ms 4428 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 38 ms 4556 KB Output is correct
2 Correct 33 ms 4172 KB Output is correct
3 Incorrect 38 ms 4684 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 47 ms 5068 KB Output is correct
2 Incorrect 46 ms 4812 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 58 ms 5752 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 56 ms 5708 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 266 ms 27688 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 297 ms 27608 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 312 ms 33092 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 349 ms 33112 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 372 ms 38584 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 443 ms 38596 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 424 ms 44100 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 467 ms 44068 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 524 ms 54980 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 583 ms 54980 KB Output isn't correct
2 Halted 0 ms 0 KB -