Submission #633262

# Submission time Handle Problem Language Result Execution time Memory
633262 2022-08-22T02:48:25 Z afatpotato Mobile (BOI12_mobile) C++14
80 / 100
1000 ms 15956 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 = 1.5e9;

    while (high - low > 1e-3) {
        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) {

            high = mid;
        } else {
            low = mid;
        }
    }
    cout << fixed;
    cout << setprecision(9);
    cout << low << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 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 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 2 ms 212 KB Output is correct
4 Correct 3 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 340 KB Output is correct
2 Correct 5 ms 372 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 6 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 340 KB Output is correct
2 Correct 6 ms 372 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 6 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 340 KB Output is correct
2 Correct 6 ms 340 KB Output is correct
3 Correct 6 ms 340 KB Output is correct
4 Correct 8 ms 340 KB Output is correct
5 Correct 5 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 79 ms 1364 KB Output is correct
2 Correct 80 ms 1492 KB Output is correct
3 Correct 57 ms 1128 KB Output is correct
4 Correct 89 ms 1464 KB Output is correct
5 Correct 42 ms 980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 74 ms 1492 KB Output is correct
2 Correct 71 ms 1400 KB Output is correct
3 Correct 88 ms 1560 KB Output is correct
4 Correct 92 ms 1532 KB Output is correct
5 Correct 111 ms 1652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 75 ms 1664 KB Output is correct
2 Correct 92 ms 1576 KB Output is correct
3 Correct 81 ms 1620 KB Output is correct
4 Correct 142 ms 1868 KB Output is correct
5 Correct 92 ms 1696 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 109 ms 1860 KB Output is correct
2 Correct 104 ms 1748 KB Output is correct
3 Correct 94 ms 1876 KB Output is correct
4 Correct 149 ms 1748 KB Output is correct
5 Correct 111 ms 1848 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 109 ms 1852 KB Output is correct
2 Correct 106 ms 1848 KB Output is correct
3 Correct 97 ms 1852 KB Output is correct
4 Correct 141 ms 1856 KB Output is correct
5 Correct 107 ms 1748 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 422 ms 8020 KB Output is correct
2 Correct 540 ms 8116 KB Output is correct
3 Correct 541 ms 8120 KB Output is correct
4 Correct 693 ms 8116 KB Output is correct
5 Correct 605 ms 8116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 574 ms 8116 KB Output is correct
2 Correct 569 ms 8120 KB Output is correct
3 Correct 513 ms 8120 KB Output is correct
4 Correct 683 ms 8116 KB Output is correct
5 Correct 567 ms 8120 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 488 ms 9804 KB Output is correct
2 Correct 667 ms 9684 KB Output is correct
3 Correct 637 ms 9684 KB Output is correct
4 Correct 835 ms 9684 KB Output is correct
5 Correct 681 ms 9684 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 683 ms 9688 KB Output is correct
2 Correct 694 ms 9684 KB Output is correct
3 Correct 553 ms 9688 KB Output is correct
4 Correct 824 ms 9684 KB Output is correct
5 Correct 699 ms 9684 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 586 ms 11220 KB Output is correct
2 Correct 766 ms 11256 KB Output is correct
3 Correct 771 ms 11244 KB Output is correct
4 Correct 950 ms 11340 KB Output is correct
5 Correct 765 ms 11264 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 817 ms 11252 KB Output is correct
2 Correct 788 ms 11244 KB Output is correct
3 Correct 676 ms 11244 KB Output is correct
4 Correct 946 ms 11248 KB Output is correct
5 Correct 790 ms 11256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 665 ms 12812 KB Output is correct
2 Correct 876 ms 12820 KB Output is correct
3 Correct 875 ms 12812 KB Output is correct
4 Execution timed out 1083 ms 12756 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 944 ms 12828 KB Output is correct
2 Correct 913 ms 12808 KB Output is correct
3 Correct 763 ms 12820 KB Output is correct
4 Execution timed out 1067 ms 12812 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 818 ms 15948 KB Output is correct
2 Execution timed out 1085 ms 15956 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1093 ms 15956 KB Time limit exceeded
2 Halted 0 ms 0 KB -