Submission #732506

# Submission time Handle Problem Language Result Execution time Memory
732506 2023-04-29T05:07:34 Z uy842003 Mobile (BOI12_mobile) C++17
75 / 100
1000 ms 15956 KB
#include <bits/stdc++.h>
using namespace std;
 
const double eps = 1e-4;
 
int main() {
 
    int n;
    double len;
    cin >> n >> len;
    vector<pair<double, double>> cor(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 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 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 4 ms 340 KB Output is correct
2 Correct 3 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 6 ms 468 KB Output is correct
2 Correct 6 ms 340 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 8 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 340 KB Output is correct
2 Correct 5 ms 340 KB Output is correct
3 Correct 5 ms 372 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 380 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 7 ms 340 KB Output is correct
5 Correct 5 ms 372 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 94 ms 1364 KB Output is correct
2 Correct 97 ms 1492 KB Output is correct
3 Correct 53 ms 1108 KB Output is correct
4 Correct 92 ms 1364 KB Output is correct
5 Correct 45 ms 1080 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 80 ms 1520 KB Output is correct
2 Correct 74 ms 1412 KB Output is correct
3 Correct 89 ms 1492 KB Output is correct
4 Correct 102 ms 1492 KB Output is correct
5 Correct 139 ms 1648 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 73 ms 1664 KB Output is correct
2 Correct 96 ms 1576 KB Output is correct
3 Correct 84 ms 1620 KB Output is correct
4 Correct 144 ms 1856 KB Output is correct
5 Correct 92 ms 1620 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 125 ms 1848 KB Output is correct
2 Correct 109 ms 1856 KB Output is correct
3 Correct 93 ms 1852 KB Output is correct
4 Correct 144 ms 1748 KB Output is correct
5 Correct 120 ms 1856 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 122 ms 1852 KB Output is correct
2 Correct 110 ms 1748 KB Output is correct
3 Correct 96 ms 1852 KB Output is correct
4 Correct 145 ms 1852 KB Output is correct
5 Correct 117 ms 1852 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 448 ms 8116 KB Output is correct
2 Correct 584 ms 8116 KB Output is correct
3 Correct 581 ms 8120 KB Output is correct
4 Correct 709 ms 8116 KB Output is correct
5 Correct 569 ms 8116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 599 ms 8020 KB Output is correct
2 Correct 606 ms 8124 KB Output is correct
3 Correct 485 ms 8128 KB Output is correct
4 Correct 727 ms 8120 KB Output is correct
5 Correct 599 ms 8120 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 536 ms 9684 KB Output is correct
2 Correct 710 ms 9804 KB Output is correct
3 Correct 651 ms 9684 KB Output is correct
4 Correct 854 ms 9684 KB Output is correct
5 Correct 701 ms 9684 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 732 ms 9684 KB Output is correct
2 Correct 727 ms 9684 KB Output is correct
3 Correct 590 ms 9684 KB Output is correct
4 Correct 881 ms 9684 KB Output is correct
5 Correct 780 ms 9688 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 613 ms 11340 KB Output is correct
2 Correct 813 ms 11244 KB Output is correct
3 Correct 798 ms 11248 KB Output is correct
4 Execution timed out 1012 ms 11248 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 834 ms 11220 KB Output is correct
2 Correct 853 ms 11252 KB Output is correct
3 Correct 677 ms 11252 KB Output is correct
4 Correct 997 ms 11248 KB Output is correct
5 Correct 866 ms 11248 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 674 ms 12812 KB Output is correct
2 Correct 928 ms 12812 KB Output is correct
3 Correct 868 ms 12812 KB Output is correct
4 Execution timed out 1058 ms 12756 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 960 ms 12812 KB Output is correct
2 Execution timed out 1014 ms 12812 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 867 ms 15956 KB Output is correct
2 Execution timed out 1082 ms 15956 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1066 ms 15956 KB Time limit exceeded
2 Halted 0 ms 0 KB -