Submission #570570

# Submission time Handle Problem Language Result Execution time Memory
570570 2022-05-30T14:06:43 Z TheEccentricDuck Mobile (BOI12_mobile) C++17
65 / 100
1000 ms 19072 KB
//======================================================================================================================
// Name        : BOI12_MOBILE.cpp
// Author      : Jinchen Li
// Date Created: 5/30/2022
// Description : oj.uz, Mobile in C++, Ansi-style
//======================================================================================================================

// Directives
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>

// Main
int main() {
    // Accepting Inputs
    int N;
    int L;
    std::cin >> N >> L;
    std::vector<double> x(N);
    std::vector<double> y(N);
    for (int i = 0; i < N; i++) {
        std::cin >> x[i] >> y[i];
    }

    // Processing Inputs
    double low = 1;
    double high = 2000000000;
    while (static_cast<long long int>(low * 10000) < static_cast<long long int>(high * 10000)) {
        double mid = (low + high) / 2;
        double cur = 0;
        for (int i = 0; i < N; i++) {
            double delta = std::sqrt(mid * mid - y[i] * y[i]);
            double a = x[i] - delta;
            double b = x[i] + delta;
            if (a <= cur) {
                cur = std::max(cur, b);
            }
        }

        if (cur >= L) {
            high = mid;
        }
        else {
            low = mid;
        }
    }

    // Printing Outputs
    std::cout << std::fixed << std::setprecision(4) << low;
}
# 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 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 340 KB Output is correct
2 Correct 3 ms 340 KB Output is correct
3 Correct 4 ms 212 KB Output is correct
4 Correct 5 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 340 KB Output is correct
2 Correct 7 ms 340 KB Output is correct
3 Correct 6 ms 340 KB Output is correct
4 Correct 7 ms 444 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 340 KB Output is correct
2 Correct 6 ms 384 KB Output is correct
3 Correct 6 ms 308 KB Output is correct
4 Correct 7 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 340 KB Output is correct
2 Correct 7 ms 372 KB Output is correct
3 Correct 4 ms 312 KB Output is correct
4 Correct 8 ms 340 KB Output is correct
5 Correct 5 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 87 ms 1364 KB Output is correct
2 Correct 85 ms 1492 KB Output is correct
3 Correct 58 ms 1636 KB Output is correct
4 Correct 108 ms 2580 KB Output is correct
5 Correct 52 ms 1584 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 99 ms 1520 KB Output is correct
2 Correct 97 ms 1392 KB Output is correct
3 Correct 101 ms 1568 KB Output is correct
4 Correct 108 ms 2628 KB Output is correct
5 Correct 124 ms 2764 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 95 ms 1620 KB Output is correct
2 Correct 97 ms 1580 KB Output is correct
3 Correct 89 ms 2512 KB Output is correct
4 Correct 169 ms 3084 KB Output is correct
5 Correct 124 ms 2736 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 129 ms 1876 KB Output is correct
2 Correct 119 ms 2864 KB Output is correct
3 Correct 93 ms 2872 KB Output is correct
4 Correct 170 ms 2976 KB Output is correct
5 Correct 138 ms 2908 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 120 ms 1748 KB Output is correct
2 Correct 115 ms 2972 KB Output is correct
3 Correct 102 ms 2852 KB Output is correct
4 Correct 171 ms 2936 KB Output is correct
5 Correct 120 ms 2920 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 456 ms 8140 KB Output is correct
2 Correct 682 ms 11640 KB Output is correct
3 Correct 611 ms 11816 KB Output is correct
4 Correct 798 ms 11608 KB Output is correct
5 Correct 628 ms 11556 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 626 ms 8116 KB Output is correct
2 Correct 643 ms 12872 KB Output is correct
3 Correct 560 ms 11632 KB Output is correct
4 Correct 792 ms 11608 KB Output is correct
5 Correct 669 ms 11608 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1088 ms 9684 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 748 ms 9684 KB Output is correct
2 Correct 796 ms 13172 KB Output is correct
3 Correct 648 ms 13244 KB Output is correct
4 Correct 944 ms 13220 KB Output is correct
5 Correct 778 ms 13296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1094 ms 11220 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 871 ms 11256 KB Output is correct
2 Correct 903 ms 14616 KB Output is correct
3 Correct 756 ms 14640 KB Output is correct
4 Execution timed out 1039 ms 14584 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 817 ms 12812 KB Output is correct
2 Correct 983 ms 16156 KB Output is correct
3 Correct 981 ms 16128 KB Output is correct
4 Execution timed out 1035 ms 15996 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1038 ms 12812 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 989 ms 16076 KB Output is correct
2 Execution timed out 1046 ms 19072 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1078 ms 15956 KB Time limit exceeded
2 Halted 0 ms 0 KB -