답안 #464204

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
464204 2021-08-12T13:43:22 Z dqk Mobile (BOI12_mobile) C++17
100 / 100
835 ms 56124 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;
        }
    }
    printf("%.6lF\n", lo);
    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 0 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 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 480 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 588 KB Output is correct
2 Correct 3 ms 460 KB Output is correct
3 Correct 4 ms 588 KB Output is correct
4 Correct 4 ms 656 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 588 KB Output is correct
2 Correct 3 ms 588 KB Output is correct
3 Correct 3 ms 588 KB Output is correct
4 Correct 4 ms 588 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 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 588 KB Output is correct
5 Correct 4 ms 716 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 62 ms 4300 KB Output is correct
2 Correct 45 ms 4496 KB Output is correct
3 Correct 32 ms 3532 KB Output is correct
4 Correct 59 ms 5084 KB Output is correct
5 Correct 32 ms 3428 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 52 ms 4584 KB Output is correct
2 Correct 49 ms 4172 KB Output is correct
3 Correct 65 ms 4684 KB Output is correct
4 Correct 59 ms 5312 KB Output is correct
5 Correct 70 ms 5820 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 59 ms 5112 KB Output is correct
2 Correct 51 ms 4812 KB Output is correct
3 Correct 54 ms 5652 KB Output is correct
4 Correct 94 ms 6416 KB Output is correct
5 Correct 61 ms 5824 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 62 ms 5828 KB Output is correct
2 Correct 72 ms 7116 KB Output is correct
3 Correct 60 ms 6808 KB Output is correct
4 Correct 95 ms 6964 KB Output is correct
5 Correct 73 ms 6980 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 64 ms 5796 KB Output is correct
2 Correct 68 ms 6424 KB Output is correct
3 Correct 60 ms 6552 KB Output is correct
4 Correct 78 ms 6444 KB Output is correct
5 Correct 71 ms 6552 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 295 ms 27704 KB Output is correct
2 Correct 322 ms 28356 KB Output is correct
3 Correct 311 ms 28920 KB Output is correct
4 Correct 401 ms 28996 KB Output is correct
5 Correct 376 ms 28980 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 315 ms 27704 KB Output is correct
2 Correct 432 ms 28484 KB Output is correct
3 Correct 339 ms 28476 KB Output is correct
4 Correct 394 ms 28452 KB Output is correct
5 Correct 407 ms 28360 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 388 ms 33188 KB Output is correct
2 Correct 401 ms 33948 KB Output is correct
3 Correct 373 ms 34468 KB Output is correct
4 Correct 480 ms 34456 KB Output is correct
5 Correct 434 ms 34464 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 392 ms 33184 KB Output is correct
2 Correct 506 ms 34372 KB Output is correct
3 Correct 374 ms 34464 KB Output is correct
4 Correct 483 ms 34464 KB Output is correct
5 Correct 471 ms 34588 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 404 ms 38664 KB Output is correct
2 Correct 460 ms 39428 KB Output is correct
3 Correct 437 ms 39944 KB Output is correct
4 Correct 580 ms 40004 KB Output is correct
5 Correct 505 ms 39944 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 449 ms 38660 KB Output is correct
2 Correct 614 ms 39376 KB Output is correct
3 Correct 442 ms 39356 KB Output is correct
4 Correct 550 ms 39428 KB Output is correct
5 Correct 534 ms 39432 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 474 ms 44136 KB Output is correct
2 Correct 495 ms 44912 KB Output is correct
3 Correct 500 ms 45380 KB Output is correct
4 Correct 649 ms 45380 KB Output is correct
5 Correct 603 ms 45420 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 522 ms 44140 KB Output is correct
2 Correct 660 ms 44912 KB Output is correct
3 Correct 510 ms 44868 KB Output is correct
4 Correct 654 ms 45036 KB Output is correct
5 Correct 600 ms 44924 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 589 ms 55044 KB Output is correct
2 Correct 648 ms 55868 KB Output is correct
3 Correct 632 ms 56124 KB Output is correct
4 Correct 786 ms 55140 KB Output is correct
5 Correct 749 ms 56124 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 641 ms 55100 KB Output is correct
2 Correct 835 ms 55864 KB Output is correct
3 Correct 633 ms 55744 KB Output is correct
4 Correct 797 ms 55128 KB Output is correct
5 Correct 756 ms 55748 KB Output is correct