Submission #914986

# Submission time Handle Problem Language Result Execution time Memory
914986 2024-01-23T05:18:20 Z Em1L Mobile (BOI12_mobile) C++17
12 / 100
282 ms 8284 KB
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using pii = pair<int, int>;
using tiiii = tuple<int, int, ll, ll>;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);

    int n, L; cin >> n >> L;

    vector < int > x(n), y(n);

    for (int i = 0; i < n; i++)
        cin >> x[i] >> y[i];

    auto Good = [&](double dist) {
        double r = 0;

        for (int i = 0; i < n; i++) {
            double left = x[i] - sqrt(dist * dist - y[i] * y[i]);
            double right = x[i] + sqrt(dist * dist - y[i] * y[i]);

            if (left <= r)
                r = max(r, right);
        }

        return r >= L;
    };

    double l = -0.1, m, r = 2e+9;

    while (r - l > 1e-6) {
        m = (l + r) / 2;

        if (Good(m))
            r = m;
        else
            l = m;
    }

    cout << setprecision(16) << fixed << r << "\n";
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 388 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Incorrect 5 ms 344 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Incorrect 3 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Incorrect 3 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 38 ms 860 KB Output is correct
2 Incorrect 23 ms 1112 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 32 ms 856 KB Output is correct
2 Correct 32 ms 856 KB Output is correct
3 Incorrect 50 ms 1084 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 21 ms 1112 KB Output is correct
2 Incorrect 22 ms 1116 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 27 ms 1504 KB Output is correct
2 Incorrect 27 ms 1112 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 27 ms 1112 KB Output is correct
2 Incorrect 27 ms 1112 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 120 ms 4184 KB Output is correct
2 Incorrect 135 ms 4188 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 141 ms 4188 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 144 ms 4956 KB Output is correct
2 Incorrect 166 ms 5148 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 165 ms 4956 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 167 ms 5928 KB Output is correct
2 Incorrect 190 ms 5928 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 191 ms 5724 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 193 ms 6712 KB Output is correct
2 Incorrect 216 ms 6712 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 221 ms 6488 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 240 ms 8280 KB Output is correct
2 Incorrect 282 ms 8284 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 270 ms 8284 KB Output isn't correct
2 Halted 0 ms 0 KB -