Submission #974391

# Submission time Handle Problem Language Result Execution time Memory
974391 2024-05-03T09:36:37 Z vjudge1 Mobile (BOI12_mobile) C++17
100 / 100
415 ms 18228 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 = 3.5E9;
        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 1 ms 348 KB Output is correct
4 Correct 0 ms 460 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 344 KB Output is correct
4 Correct 0 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 496 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 344 KB Output is correct
2 Correct 2 ms 348 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 348 KB Output is correct
2 Correct 2 ms 472 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 2 ms 420 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 812 KB Output is correct
3 Correct 2 ms 348 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 29 ms 1628 KB Output is correct
2 Correct 21 ms 1624 KB Output is correct
3 Correct 15 ms 1368 KB Output is correct
4 Correct 26 ms 1624 KB Output is correct
5 Correct 15 ms 1228 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 23 ms 1368 KB Output is correct
2 Correct 26 ms 1624 KB Output is correct
3 Correct 27 ms 1828 KB Output is correct
4 Correct 28 ms 1628 KB Output is correct
5 Correct 31 ms 2140 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 1624 KB Output is correct
2 Correct 22 ms 1628 KB Output is correct
3 Correct 23 ms 1880 KB Output is correct
4 Correct 41 ms 2392 KB Output is correct
5 Correct 28 ms 1880 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 28 ms 2136 KB Output is correct
2 Correct 28 ms 2388 KB Output is correct
3 Correct 27 ms 1884 KB Output is correct
4 Correct 38 ms 2516 KB Output is correct
5 Correct 34 ms 1884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 29 ms 2132 KB Output is correct
2 Correct 29 ms 2136 KB Output is correct
3 Correct 27 ms 1884 KB Output is correct
4 Correct 38 ms 2396 KB Output is correct
5 Correct 33 ms 1880 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 123 ms 6480 KB Output is correct
2 Correct 137 ms 8328 KB Output is correct
3 Correct 136 ms 7948 KB Output is correct
4 Correct 192 ms 9460 KB Output is correct
5 Correct 165 ms 7924 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 157 ms 8668 KB Output is correct
2 Correct 261 ms 7804 KB Output is correct
3 Correct 135 ms 7252 KB Output is correct
4 Correct 194 ms 9220 KB Output is correct
5 Correct 166 ms 8020 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 157 ms 7764 KB Output is correct
2 Correct 170 ms 9812 KB Output is correct
3 Correct 173 ms 9624 KB Output is correct
4 Correct 238 ms 11268 KB Output is correct
5 Correct 197 ms 9344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 173 ms 10044 KB Output is correct
2 Correct 281 ms 8976 KB Output is correct
3 Correct 172 ms 8600 KB Output is correct
4 Correct 233 ms 11144 KB Output is correct
5 Correct 212 ms 9496 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 172 ms 9248 KB Output is correct
2 Correct 200 ms 11344 KB Output is correct
3 Correct 204 ms 11416 KB Output is correct
4 Correct 271 ms 12824 KB Output is correct
5 Correct 237 ms 10576 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 204 ms 11992 KB Output is correct
2 Correct 315 ms 10644 KB Output is correct
3 Correct 204 ms 10148 KB Output is correct
4 Correct 263 ms 12584 KB Output is correct
5 Correct 242 ms 11172 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 199 ms 10488 KB Output is correct
2 Correct 220 ms 13092 KB Output is correct
3 Correct 220 ms 12880 KB Output is correct
4 Correct 337 ms 14672 KB Output is correct
5 Correct 262 ms 12372 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 231 ms 13524 KB Output is correct
2 Correct 333 ms 12300 KB Output is correct
3 Correct 233 ms 11704 KB Output is correct
4 Correct 378 ms 14388 KB Output is correct
5 Correct 273 ms 12708 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 243 ms 12676 KB Output is correct
2 Correct 279 ms 16084 KB Output is correct
3 Correct 267 ms 15440 KB Output is correct
4 Correct 363 ms 17860 KB Output is correct
5 Correct 336 ms 15168 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 282 ms 16520 KB Output is correct
2 Correct 415 ms 14928 KB Output is correct
3 Correct 272 ms 14672 KB Output is correct
4 Correct 376 ms 18228 KB Output is correct
5 Correct 343 ms 15700 KB Output is correct