Submission #974383

# Submission time Handle Problem Language Result Execution time Memory
974383 2024-05-03T09:29:25 Z vjudge1 Mobile (BOI12_mobile) C++17
100 / 100
418 ms 27588 KB
#include <bits/stdc++.h>
using i64 = long long;

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int N, L;
    std::cin >> N >> L;

    std::vector<std::pair<int, int>> p(N);
    for (auto &[x, y] : p) {
        std::cin >> x >> y;
    }

    auto check = [&](double r) {
        double cur = 0;
        for (auto [x, y] : p) {
            double d = std::sqrt(r * r - 1.0 * y * y);
            if (x - d <= cur) {
                cur = std::max(cur, x + d);
            }
        }
        return cur >= L;
    };

    double ans = [&]() {
        double l = 0, r = 3E9;
        while (r - l > 1E-5) {
            double x = l + (r - l) / 2;
            if (check(x)) {
                r = x;
            } else {
                l = x;
            }
        }
        return l;
    }();

    std::cout << std::fixed << std::setprecision(4) << ans << "\n";

    return 0;
}
# 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 1 ms 348 KB Output is correct
# 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 1 ms 344 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 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 492 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 2 ms 344 KB Output is correct
4 Correct 2 ms 348 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 496 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
5 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 30 ms 860 KB Output is correct
2 Correct 20 ms 860 KB Output is correct
3 Correct 16 ms 1372 KB Output is correct
4 Correct 27 ms 2140 KB Output is correct
5 Correct 14 ms 1116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 856 KB Output is correct
2 Correct 25 ms 860 KB Output is correct
3 Correct 27 ms 856 KB Output is correct
4 Correct 28 ms 2140 KB Output is correct
5 Correct 32 ms 2548 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 23 ms 1112 KB Output is correct
2 Correct 22 ms 860 KB Output is correct
3 Correct 24 ms 1880 KB Output is correct
4 Correct 38 ms 3164 KB Output is correct
5 Correct 28 ms 1884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 1112 KB Output is correct
2 Correct 31 ms 1116 KB Output is correct
3 Correct 29 ms 2132 KB Output is correct
4 Correct 44 ms 3164 KB Output is correct
5 Correct 32 ms 2392 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 31 ms 1112 KB Output is correct
2 Correct 27 ms 1116 KB Output is correct
3 Correct 26 ms 2140 KB Output is correct
4 Correct 39 ms 3148 KB Output is correct
5 Correct 33 ms 2392 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 122 ms 4184 KB Output is correct
2 Correct 143 ms 4188 KB Output is correct
3 Correct 142 ms 11508 KB Output is correct
4 Correct 190 ms 13904 KB Output is correct
5 Correct 174 ms 11344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 147 ms 4188 KB Output is correct
2 Correct 222 ms 10832 KB Output is correct
3 Correct 137 ms 9852 KB Output is correct
4 Correct 191 ms 13648 KB Output is correct
5 Correct 164 ms 11600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 161 ms 4952 KB Output is correct
2 Correct 167 ms 4956 KB Output is correct
3 Correct 160 ms 13648 KB Output is correct
4 Correct 226 ms 16980 KB Output is correct
5 Correct 201 ms 12936 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 172 ms 4956 KB Output is correct
2 Correct 262 ms 12804 KB Output is correct
3 Correct 174 ms 11860 KB Output is correct
4 Correct 220 ms 16644 KB Output is correct
5 Correct 206 ms 13828 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 178 ms 5724 KB Output is correct
2 Correct 191 ms 5920 KB Output is correct
3 Correct 188 ms 15900 KB Output is correct
4 Correct 264 ms 19284 KB Output is correct
5 Correct 230 ms 14752 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 200 ms 5720 KB Output is correct
2 Correct 293 ms 14932 KB Output is correct
3 Correct 203 ms 14232 KB Output is correct
4 Correct 256 ms 19220 KB Output is correct
5 Correct 246 ms 15952 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 199 ms 6488 KB Output is correct
2 Correct 212 ms 6488 KB Output is correct
3 Correct 217 ms 18096 KB Output is correct
4 Correct 302 ms 22096 KB Output is correct
5 Correct 269 ms 17744 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 221 ms 6744 KB Output is correct
2 Correct 353 ms 17236 KB Output is correct
3 Correct 232 ms 16172 KB Output is correct
4 Correct 309 ms 21924 KB Output is correct
5 Correct 282 ms 18260 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 251 ms 8280 KB Output is correct
2 Correct 291 ms 8284 KB Output is correct
3 Correct 268 ms 22712 KB Output is correct
4 Correct 382 ms 27204 KB Output is correct
5 Correct 335 ms 21588 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 269 ms 8280 KB Output is correct
2 Correct 410 ms 21312 KB Output is correct
3 Correct 299 ms 20548 KB Output is correct
4 Correct 418 ms 27588 KB Output is correct
5 Correct 358 ms 22864 KB Output is correct