Submission #570573

# Submission time Handle Problem Language Result Execution time Memory
570573 2022-05-30T14:12:22 Z TheEccentricDuck Mobile (BOI12_mobile) C++17
90 / 100
1000 ms 19812 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() {
    // Initialisation
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);

    // 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 1 ms 212 KB Output is correct
# 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 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 340 KB Output is correct
2 Correct 3 ms 396 KB Output is correct
3 Correct 3 ms 340 KB Output is correct
4 Correct 4 ms 340 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 3 ms 340 KB Output is correct
4 Correct 4 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 340 KB Output is correct
2 Correct 4 ms 340 KB Output is correct
3 Correct 3 ms 340 KB Output is correct
4 Correct 5 ms 340 KB Output is correct
5 Correct 4 ms 400 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 51 ms 1492 KB Output is correct
2 Correct 50 ms 1516 KB Output is correct
3 Correct 29 ms 1108 KB Output is correct
4 Correct 55 ms 1492 KB Output is correct
5 Correct 28 ms 1108 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 53 ms 1492 KB Output is correct
2 Correct 56 ms 1416 KB Output is correct
3 Correct 64 ms 1580 KB Output is correct
4 Correct 55 ms 1492 KB Output is correct
5 Correct 64 ms 1672 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 43 ms 1688 KB Output is correct
2 Correct 49 ms 1492 KB Output is correct
3 Correct 55 ms 1740 KB Output is correct
4 Correct 89 ms 1876 KB Output is correct
5 Correct 52 ms 1620 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 71 ms 1888 KB Output is correct
2 Correct 65 ms 1880 KB Output is correct
3 Correct 61 ms 1876 KB Output is correct
4 Correct 88 ms 1884 KB Output is correct
5 Correct 79 ms 1880 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 64 ms 1876 KB Output is correct
2 Correct 60 ms 1876 KB Output is correct
3 Correct 54 ms 1880 KB Output is correct
4 Correct 78 ms 1876 KB Output is correct
5 Correct 65 ms 1884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 334 ms 8148 KB Output is correct
2 Correct 297 ms 8148 KB Output is correct
3 Correct 348 ms 8148 KB Output is correct
4 Correct 388 ms 8148 KB Output is correct
5 Correct 356 ms 8148 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 399 ms 8148 KB Output is correct
2 Correct 430 ms 8148 KB Output is correct
3 Correct 307 ms 8152 KB Output is correct
4 Correct 395 ms 8148 KB Output is correct
5 Correct 416 ms 8148 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1092 ms 9684 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 373 ms 9708 KB Output is correct
2 Correct 470 ms 9716 KB Output is correct
3 Correct 387 ms 9704 KB Output is correct
4 Correct 547 ms 9704 KB Output is correct
5 Correct 445 ms 9704 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1092 ms 11220 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 444 ms 11336 KB Output is correct
2 Correct 631 ms 11276 KB Output is correct
3 Correct 393 ms 11292 KB Output is correct
4 Correct 647 ms 11276 KB Output is correct
5 Correct 542 ms 14636 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 450 ms 12836 KB Output is correct
2 Correct 523 ms 12844 KB Output is correct
3 Correct 499 ms 12840 KB Output is correct
4 Correct 641 ms 12756 KB Output is correct
5 Correct 567 ms 16072 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 542 ms 12836 KB Output is correct
2 Correct 654 ms 12836 KB Output is correct
3 Correct 559 ms 16076 KB Output is correct
4 Correct 678 ms 15996 KB Output is correct
5 Correct 636 ms 15948 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 574 ms 15976 KB Output is correct
2 Correct 715 ms 15988 KB Output is correct
3 Correct 702 ms 19168 KB Output is correct
4 Correct 823 ms 16080 KB Output is correct
5 Correct 714 ms 19204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 679 ms 15976 KB Output is correct
2 Correct 835 ms 19812 KB Output is correct
3 Correct 585 ms 18952 KB Output is correct
4 Correct 879 ms 16084 KB Output is correct
5 Correct 695 ms 19040 KB Output is correct