Submission #658589

# Submission time Handle Problem Language Result Execution time Memory
658589 2022-11-13T15:32:20 Z finn__ Mobile (BOI12_mobile) C++17
0 / 100
1000 ms 43188 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 = 1e9;
    while (b - a > 1e-5)
    {
        long double r = (a + b) / 2, covered_until = p[0].real();

        for (size_t i = 0; i < n; i++)
        {
            if (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 << a << '\n';
}
# 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 Incorrect 1 ms 296 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 440 KB Output is correct
2 Correct 3 ms 468 KB Output is correct
3 Incorrect 4 ms 340 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 7 ms 724 KB Output is correct
2 Incorrect 7 ms 664 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 692 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 7 ms 724 KB Output is correct
2 Incorrect 6 ms 696 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 93 ms 5248 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 110 ms 5180 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 97 ms 5116 KB Output is correct
2 Incorrect 104 ms 5592 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 124 ms 5712 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 130 ms 5668 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 533 ms 20248 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 606 ms 24252 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 619 ms 38004 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 747 ms 42108 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 720 ms 37948 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 838 ms 42004 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 816 ms 38016 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 966 ms 42328 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1002 ms 40624 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1030 ms 43188 KB Time limit exceeded
2 Halted 0 ms 0 KB -