답안 #464198

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
464198 2021-08-12T13:40:26 Z dqk Mobile (BOI12_mobile) C++17
65 / 100
850 ms 55144 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 - (1.0 * 1ll * p[i][1]) * (1.0 * 1ll * p[i][1]));
            if (cur >= 1.0 * p[i][0] - d)
                cur = std::max(cur, 1.0 * p[i][0] + d);
        }
        if (cur >= L) {
            hi = mi;
        }
        else {
            lo = mi;
        }
    }
    std::cout << std::setprecision(10) << lo << "\n";
    return 0;
}

# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 592 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
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 460 KB Output is correct
2 Correct 3 ms 560 KB Output is correct
3 Correct 3 ms 460 KB Output is correct
4 Correct 4 ms 460 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 588 KB Output is correct
2 Correct 4 ms 460 KB Output is correct
3 Correct 3 ms 560 KB Output is correct
4 Correct 4 ms 560 KB Output is correct
5 Correct 4 ms 460 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 61 ms 4300 KB Output is correct
2 Correct 49 ms 4428 KB Output is correct
3 Correct 31 ms 3148 KB Output is correct
4 Correct 53 ms 4428 KB Output is correct
5 Correct 30 ms 3020 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 51 ms 4556 KB Output is correct
2 Correct 50 ms 4172 KB Output is correct
3 Correct 57 ms 4684 KB Output is correct
4 Correct 56 ms 4556 KB Output is correct
5 Correct 64 ms 5068 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 47 ms 5068 KB Output is correct
2 Correct 48 ms 4812 KB Output is correct
3 Correct 50 ms 4940 KB Output is correct
4 Correct 81 ms 5740 KB Output is correct
5 Correct 59 ms 5196 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 61 ms 5708 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 61 ms 5672 KB Output is correct
2 Correct 60 ms 5708 KB Output is correct
3 Correct 59 ms 5708 KB Output is correct
4 Correct 76 ms 5708 KB Output is correct
5 Correct 70 ms 5708 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 285 ms 27588 KB Output is correct
2 Incorrect 301 ms 27596 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 315 ms 27668 KB Output is correct
2 Correct 417 ms 27716 KB Output is correct
3 Correct 301 ms 27628 KB Output is correct
4 Correct 410 ms 27596 KB Output is correct
5 Correct 362 ms 27596 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 350 ms 33092 KB Output is correct
2 Incorrect 366 ms 33096 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 370 ms 33068 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 391 ms 38600 KB Output is correct
2 Incorrect 437 ms 38576 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 453 ms 38592 KB Output is correct
2 Correct 599 ms 38596 KB Output is correct
3 Correct 442 ms 38612 KB Output is correct
4 Correct 544 ms 38608 KB Output is correct
5 Correct 516 ms 38624 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 475 ms 44100 KB Output is correct
2 Incorrect 484 ms 44084 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 503 ms 44096 KB Output is correct
2 Correct 657 ms 44100 KB Output is correct
3 Correct 502 ms 44132 KB Output is correct
4 Correct 641 ms 44096 KB Output is correct
5 Correct 599 ms 44072 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 583 ms 55108 KB Output is correct
2 Incorrect 613 ms 55000 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 613 ms 55108 KB Output is correct
2 Correct 850 ms 55020 KB Output is correct
3 Correct 633 ms 55012 KB Output is correct
4 Correct 793 ms 55144 KB Output is correct
5 Correct 728 ms 55060 KB Output is correct