Submission #658591

# Submission time Handle Problem Language Result Execution time Memory
658591 2022-11-13T15:34:45 Z finn__ Mobile (BOI12_mobile) C++17
0 / 100
1000 ms 41652 KB
#include <bits/stdc++.h>
using namespace std;

int main()
{
    size_t n;
    long double l;
    cin >> n >> l;

    vector<complex<long double>> p;
    for (size_t i = 0; i < n; i++)
    {
        long double x, y;
        cin >> x >> y;
        p.push_back({x, y});
    }

    long double a = 0.0, b = 1e15;
    while (b - a > 1e-6)
    {
        long double r = (a + b) / 2, covered_until = p[0].real();

        for (size_t i = 0; i < n; i++)
        {
            if (abs(p[i].imag()) <= r)
            {
                long double delta_x = sqrt(r * r - p[i].imag() * p[i].imag());
                if (p[i].real() - delta_x <= covered_until)
                    covered_until = max(covered_until, p[i].real() + delta_x);
            }
        }

        if (covered_until >= l)
            b = r;
        else
            a = r;
    }

    cout << fixed << setprecision(10) << a << '\n';
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 444 KB Output is correct
2 Correct 3 ms 468 KB Output is correct
3 Incorrect 3 ms 340 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 724 KB Output is correct
2 Incorrect 7 ms 696 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 708 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 8 ms 724 KB Output is correct
2 Incorrect 9 ms 724 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 101 ms 4672 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 95 ms 4784 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 109 ms 4808 KB Output is correct
2 Incorrect 117 ms 4836 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 145 ms 4776 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 149 ms 4784 KB Output is correct
2 Incorrect 158 ms 5672 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 620 ms 17008 KB Output is correct
2 Incorrect 679 ms 23880 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 748 ms 17032 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 779 ms 33444 KB Output is correct
2 Incorrect 836 ms 41652 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 903 ms 33424 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 942 ms 33608 KB Output is correct
2 Incorrect 966 ms 41604 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 969 ms 33432 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1004 ms 33584 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1033 ms 33508 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1071 ms 33508 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1080 ms 33604 KB Time limit exceeded
2 Halted 0 ms 0 KB -