Submission #570576

# Submission time Handle Problem Language Result Execution time Memory
570576 2022-05-30T14:17:20 Z TheEccentricDuck Mobile (BOI12_mobile) C++17
90 / 100
1000 ms 15980 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>
#pragma GCC optimize ("Ofast")
#pragma GCC target ("avx2")

// 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 = 1000000000;
    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 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 360 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 3 ms 340 KB Output is correct
4 Correct 2 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 4 ms 340 KB Output is correct
4 Correct 5 ms 468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 340 KB Output is correct
2 Correct 5 ms 340 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 5 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 400 KB Output is correct
2 Correct 4 ms 340 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 5 ms 340 KB Output is correct
5 Correct 4 ms 392 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 78 ms 1492 KB Output is correct
2 Correct 60 ms 1492 KB Output is correct
3 Correct 39 ms 1108 KB Output is correct
4 Correct 71 ms 1492 KB Output is correct
5 Correct 33 ms 1108 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 55 ms 1616 KB Output is correct
2 Correct 58 ms 1416 KB Output is correct
3 Correct 67 ms 1492 KB Output is correct
4 Correct 71 ms 1492 KB Output is correct
5 Correct 83 ms 1740 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 62 ms 1620 KB Output is correct
2 Correct 60 ms 1620 KB Output is correct
3 Correct 69 ms 1640 KB Output is correct
4 Correct 89 ms 1876 KB Output is correct
5 Correct 64 ms 1620 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 74 ms 1876 KB Output is correct
2 Correct 74 ms 1876 KB Output is correct
3 Correct 77 ms 1876 KB Output is correct
4 Correct 108 ms 1880 KB Output is correct
5 Correct 90 ms 1876 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 85 ms 1880 KB Output is correct
2 Correct 73 ms 1876 KB Output is correct
3 Correct 76 ms 1884 KB Output is correct
4 Correct 89 ms 1876 KB Output is correct
5 Correct 79 ms 1884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 394 ms 8156 KB Output is correct
2 Correct 441 ms 8148 KB Output is correct
3 Correct 383 ms 8152 KB Output is correct
4 Correct 494 ms 8160 KB Output is correct
5 Correct 407 ms 8148 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 386 ms 8148 KB Output is correct
2 Correct 531 ms 8148 KB Output is correct
3 Correct 346 ms 8148 KB Output is correct
4 Correct 459 ms 8148 KB Output is correct
5 Correct 425 ms 8148 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1089 ms 9684 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 461 ms 9704 KB Output is correct
2 Correct 558 ms 9716 KB Output is correct
3 Correct 465 ms 9700 KB Output is correct
4 Correct 548 ms 9700 KB Output is correct
5 Correct 502 ms 9704 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1057 ms 11220 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 572 ms 11276 KB Output is correct
2 Correct 638 ms 11220 KB Output is correct
3 Correct 536 ms 11280 KB Output is correct
4 Correct 662 ms 11280 KB Output is correct
5 Correct 615 ms 11276 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 667 ms 12836 KB Output is correct
2 Correct 628 ms 12840 KB Output is correct
3 Correct 611 ms 12836 KB Output is correct
4 Correct 751 ms 12756 KB Output is correct
5 Correct 675 ms 12840 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 612 ms 12840 KB Output is correct
2 Correct 762 ms 12840 KB Output is correct
3 Correct 598 ms 12840 KB Output is correct
4 Correct 753 ms 12844 KB Output is correct
5 Correct 678 ms 12840 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 782 ms 15980 KB Output is correct
2 Correct 813 ms 15976 KB Output is correct
3 Correct 822 ms 15980 KB Output is correct
4 Correct 918 ms 15972 KB Output is correct
5 Correct 825 ms 15980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 750 ms 15972 KB Output is correct
2 Correct 871 ms 15976 KB Output is correct
3 Correct 745 ms 15956 KB Output is correct
4 Correct 965 ms 15972 KB Output is correct
5 Correct 848 ms 15980 KB Output is correct