답안 #633260

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
633260 2022-08-22T02:45:20 Z afatpotato Mobile (BOI12_mobile) C++14
75 / 100
1000 ms 31424 KB
#include <bits/stdc++.h>

using namespace std;



vector<pair<double, double> > tower;
long long n, l;

int main() {
    cin >> n >> l;
    tower.resize(n);
    for (int i = 0; i < n; i++) {
        cin >> tower[i].first >> tower[i].second;
    }
    sort(tower.begin(), tower.end());
    double low = 0;
    double high = 4e9;
    double ans = 0;

    while (high - low > 1e-4) {
        double mid = (low + high) / 2;
        double cur = 0;
        for (int i = 0; i < n; i++) {
            double delta = sqrt(mid * mid - tower[i].second * tower[i].second);
            double a = tower[i].first - delta;
            double b = tower[i].first + delta;
            if (a <= cur) {
                cur = max(cur, b);
            }
        }
        if (cur > l) {
            ans = mid;
            high = mid;
        } else {
            low = mid;
        }
    }
    cout << fixed;
    cout << setprecision(9);
    cout << ans << endl;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 336 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 3 ms 340 KB Output is correct
4 Correct 4 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 340 KB Output is correct
2 Correct 6 ms 440 KB Output is correct
3 Correct 5 ms 340 KB Output is correct
4 Correct 6 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 376 KB Output is correct
2 Correct 6 ms 444 KB Output is correct
3 Correct 7 ms 340 KB Output is correct
4 Correct 7 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 372 KB Output is correct
2 Correct 6 ms 436 KB Output is correct
3 Correct 7 ms 420 KB Output is correct
4 Correct 7 ms 340 KB Output is correct
5 Correct 5 ms 312 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 95 ms 1460 KB Output is correct
2 Correct 95 ms 2496 KB Output is correct
3 Correct 54 ms 1760 KB Output is correct
4 Correct 94 ms 2616 KB Output is correct
5 Correct 45 ms 1464 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 80 ms 1516 KB Output is correct
2 Correct 78 ms 2148 KB Output is correct
3 Correct 100 ms 2640 KB Output is correct
4 Correct 98 ms 2680 KB Output is correct
5 Correct 117 ms 3080 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 86 ms 1620 KB Output is correct
2 Correct 88 ms 1492 KB Output is correct
3 Correct 86 ms 1620 KB Output is correct
4 Correct 141 ms 1852 KB Output is correct
5 Correct 90 ms 2576 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 114 ms 1856 KB Output is correct
2 Correct 126 ms 1868 KB Output is correct
3 Correct 102 ms 1856 KB Output is correct
4 Correct 173 ms 1868 KB Output is correct
5 Correct 109 ms 2988 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 116 ms 1856 KB Output is correct
2 Correct 110 ms 1748 KB Output is correct
3 Correct 105 ms 1748 KB Output is correct
4 Correct 143 ms 1748 KB Output is correct
5 Correct 111 ms 3124 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 445 ms 8120 KB Output is correct
2 Correct 581 ms 15824 KB Output is correct
3 Correct 562 ms 15348 KB Output is correct
4 Correct 703 ms 17700 KB Output is correct
5 Correct 701 ms 14900 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 637 ms 8116 KB Output is correct
2 Correct 621 ms 14768 KB Output is correct
3 Correct 514 ms 13868 KB Output is correct
4 Correct 699 ms 17576 KB Output is correct
5 Correct 599 ms 15408 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 526 ms 9804 KB Output is correct
2 Correct 703 ms 19032 KB Output is correct
3 Correct 677 ms 18388 KB Output is correct
4 Correct 896 ms 21588 KB Output is correct
5 Correct 691 ms 17612 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 713 ms 9684 KB Output is correct
2 Correct 742 ms 17616 KB Output is correct
3 Correct 601 ms 16524 KB Output is correct
4 Correct 848 ms 21432 KB Output is correct
5 Correct 715 ms 18384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 609 ms 11248 KB Output is correct
2 Correct 811 ms 22252 KB Output is correct
3 Correct 782 ms 21356 KB Output is correct
4 Execution timed out 1008 ms 24944 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 834 ms 11256 KB Output is correct
2 Correct 867 ms 20628 KB Output is correct
3 Correct 703 ms 19564 KB Output is correct
4 Correct 979 ms 24660 KB Output is correct
5 Correct 851 ms 21392 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 704 ms 12756 KB Output is correct
2 Execution timed out 1014 ms 25232 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 946 ms 12816 KB Output is correct
2 Correct 990 ms 23448 KB Output is correct
3 Correct 809 ms 22288 KB Output is correct
4 Execution timed out 1087 ms 28316 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 868 ms 15944 KB Output is correct
2 Execution timed out 1094 ms 31424 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1092 ms 15956 KB Time limit exceeded
2 Halted 0 ms 0 KB -