Submission #732508

# Submission time Handle Problem Language Result Execution time Memory
732508 2023-04-29T05:09:09 Z uy842003 Mobile (BOI12_mobile) C++17
80 / 100
1000 ms 19252 KB
#include <bits/stdc++.h>
using namespace std;
 
const double eps = 1e-4;
 
int main() {
 
    int n;
    double len;
    cin >> n >> len;
    pair<double, double> *cor = new pair<double, double>[n];
    for (int i = 0; i < n; i++)
        cin >> cor[i].first >> cor[i].second;
    double l = 0, r = 4e9 + 1, m;
    while (r - l > eps) {
        m = (l + r) / 2;
        double cur_pos = 0;
        for (int i = 0; i < n; i++) {
            double dx = sqrt(m * m - cor[i].second * cor[i].second);
            if (cor[i].first - dx < cur_pos + eps) cur_pos = max(cur_pos, cor[i].first + dx);
        }
        if (len < cur_pos + eps)
            r = m;
        else
            l = m + eps;
    }
    cout << setprecision(3) << fixed << r << endl;
 
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 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 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 340 KB Output is correct
2 Correct 3 ms 336 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 9 ms 376 KB Output is correct
2 Correct 6 ms 340 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 7 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 372 KB Output is correct
2 Correct 6 ms 340 KB Output is correct
3 Correct 5 ms 380 KB Output is correct
4 Correct 7 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 7 ms 368 KB Output is correct
4 Correct 7 ms 376 KB Output is correct
5 Correct 4 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 89 ms 1460 KB Output is correct
2 Correct 94 ms 1492 KB Output is correct
3 Correct 56 ms 1108 KB Output is correct
4 Correct 115 ms 1472 KB Output is correct
5 Correct 52 ms 980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 91 ms 1512 KB Output is correct
2 Correct 95 ms 1396 KB Output is correct
3 Correct 110 ms 1564 KB Output is correct
4 Correct 113 ms 1492 KB Output is correct
5 Correct 146 ms 1648 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 97 ms 1664 KB Output is correct
2 Correct 111 ms 1572 KB Output is correct
3 Correct 95 ms 1620 KB Output is correct
4 Correct 162 ms 1848 KB Output is correct
5 Correct 102 ms 1680 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 128 ms 1856 KB Output is correct
2 Correct 119 ms 1856 KB Output is correct
3 Correct 107 ms 1856 KB Output is correct
4 Correct 161 ms 1852 KB Output is correct
5 Correct 124 ms 1876 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 129 ms 1852 KB Output is correct
2 Correct 136 ms 1876 KB Output is correct
3 Correct 104 ms 1856 KB Output is correct
4 Correct 166 ms 1856 KB Output is correct
5 Correct 128 ms 1852 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 483 ms 8120 KB Output is correct
2 Correct 654 ms 8120 KB Output is correct
3 Correct 602 ms 8244 KB Output is correct
4 Correct 776 ms 8756 KB Output is correct
5 Correct 656 ms 9140 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 627 ms 10416 KB Output is correct
2 Correct 635 ms 9144 KB Output is correct
3 Correct 497 ms 9144 KB Output is correct
4 Correct 703 ms 9020 KB Output is correct
5 Correct 606 ms 9168 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 586 ms 12032 KB Output is correct
2 Correct 677 ms 10588 KB Output is correct
3 Correct 652 ms 10576 KB Output is correct
4 Correct 888 ms 10584 KB Output is correct
5 Correct 653 ms 10688 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 705 ms 11880 KB Output is correct
2 Correct 729 ms 10704 KB Output is correct
3 Correct 594 ms 10792 KB Output is correct
4 Correct 875 ms 10584 KB Output is correct
5 Correct 734 ms 10580 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 647 ms 13460 KB Output is correct
2 Correct 785 ms 12256 KB Output is correct
3 Correct 782 ms 12152 KB Output is correct
4 Correct 992 ms 12148 KB Output is correct
5 Correct 801 ms 12148 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 851 ms 13616 KB Output is correct
2 Correct 829 ms 12148 KB Output is correct
3 Correct 718 ms 12156 KB Output is correct
4 Correct 981 ms 12152 KB Output is correct
5 Correct 844 ms 12152 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 686 ms 14744 KB Output is correct
2 Correct 929 ms 13740 KB Output is correct
3 Correct 900 ms 13720 KB Output is correct
4 Execution timed out 1067 ms 14204 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 988 ms 16368 KB Output is correct
2 Execution timed out 1022 ms 13784 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 897 ms 18324 KB Output is correct
2 Execution timed out 1041 ms 16948 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1067 ms 19252 KB Time limit exceeded
2 Halted 0 ms 0 KB -