Submission #633265

# Submission time Handle Problem Language Result Execution time Memory
633265 2022-08-22T02:51:55 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;
    }

    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(4);
    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 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 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 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 340 KB Output is correct
2 Correct 5 ms 340 KB Output is correct
3 Correct 5 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 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 5 ms 340 KB Output is correct
3 Correct 4 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 1460 KB Output is correct
2 Correct 86 ms 1504 KB Output is correct
3 Correct 51 ms 1128 KB Output is correct
4 Correct 94 ms 1468 KB Output is correct
5 Correct 41 ms 980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 70 ms 1492 KB Output is correct
2 Correct 69 ms 1392 KB Output is correct
3 Correct 89 ms 1556 KB Output is correct
4 Correct 96 ms 1536 KB Output is correct
5 Correct 107 ms 1652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 67 ms 1620 KB Output is correct
2 Correct 87 ms 1492 KB Output is correct
3 Correct 79 ms 1620 KB Output is correct
4 Correct 135 ms 1848 KB Output is correct
5 Correct 84 ms 1620 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 112 ms 1856 KB Output is correct
2 Correct 102 ms 1748 KB Output is correct
3 Correct 89 ms 1856 KB Output is correct
4 Correct 147 ms 1876 KB Output is correct
5 Correct 107 ms 1856 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 111 ms 1852 KB Output is correct
2 Correct 109 ms 1856 KB Output is correct
3 Correct 90 ms 1852 KB Output is correct
4 Correct 136 ms 1852 KB Output is correct
5 Correct 106 ms 1852 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 453 ms 8120 KB Output is correct
2 Correct 540 ms 8120 KB Output is correct
3 Correct 532 ms 8120 KB Output is correct
4 Correct 669 ms 8120 KB Output is correct
5 Correct 576 ms 8124 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 566 ms 8112 KB Output is correct
2 Correct 603 ms 8128 KB Output is correct
3 Correct 474 ms 8120 KB Output is correct
4 Correct 661 ms 8136 KB Output is correct
5 Correct 593 ms 8120 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 487 ms 9684 KB Output is correct
2 Correct 687 ms 9688 KB Output is correct
3 Correct 616 ms 9688 KB Output is correct
4 Correct 828 ms 9700 KB Output is correct
5 Correct 652 ms 9684 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 673 ms 9684 KB Output is correct
2 Correct 698 ms 9684 KB Output is correct
3 Correct 557 ms 9684 KB Output is correct
4 Correct 836 ms 9684 KB Output is correct
5 Correct 699 ms 9656 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 567 ms 11252 KB Output is correct
2 Correct 752 ms 11256 KB Output is correct
3 Correct 719 ms 11252 KB Output is correct
4 Correct 950 ms 11248 KB Output is correct
5 Correct 745 ms 11256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 784 ms 11348 KB Output is correct
2 Correct 794 ms 11256 KB Output is correct
3 Correct 653 ms 11268 KB Output is correct
4 Correct 934 ms 11248 KB Output is correct
5 Correct 803 ms 11252 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 631 ms 12816 KB Output is correct
2 Correct 855 ms 12812 KB Output is correct
3 Correct 828 ms 12832 KB Output is correct
4 Execution timed out 1072 ms 12816 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 893 ms 12812 KB Output is correct
2 Correct 901 ms 12828 KB Output is correct
3 Correct 752 ms 12876 KB Output is correct
4 Execution timed out 1080 ms 12824 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 810 ms 15956 KB Output is correct
2 Execution timed out 1073 ms 15956 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1087 ms 15956 KB Time limit exceeded
2 Halted 0 ms 0 KB -