답안 #570575

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
570575 2022-05-30T14:15:30 Z TheEccentricDuck Mobile (BOI12_mobile) C++17
90 / 100
1000 ms 16076 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 = 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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 340 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 3 ms 340 KB Output is correct
4 Correct 3 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 400 KB Output is correct
2 Correct 6 ms 340 KB Output is correct
3 Correct 5 ms 340 KB Output is correct
4 Correct 5 ms 400 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 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
# 결과 실행 시간 메모리 Grader output
1 Correct 5 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 340 KB Output is correct
5 Correct 5 ms 404 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 74 ms 1492 KB Output is correct
2 Correct 58 ms 1492 KB Output is correct
3 Correct 40 ms 1152 KB Output is correct
4 Correct 66 ms 1492 KB Output is correct
5 Correct 39 ms 1116 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 60 ms 1492 KB Output is correct
2 Correct 56 ms 1420 KB Output is correct
3 Correct 65 ms 1492 KB Output is correct
4 Correct 67 ms 1492 KB Output is correct
5 Correct 84 ms 1672 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 66 ms 1620 KB Output is correct
2 Correct 66 ms 1492 KB Output is correct
3 Correct 68 ms 1640 KB Output is correct
4 Correct 90 ms 1876 KB Output is correct
5 Correct 66 ms 1712 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 95 ms 1876 KB Output is correct
2 Correct 76 ms 1876 KB Output is correct
3 Correct 78 ms 1884 KB Output is correct
4 Correct 101 ms 1876 KB Output is correct
5 Correct 80 ms 1876 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 90 ms 1884 KB Output is correct
2 Correct 78 ms 1876 KB Output is correct
3 Correct 74 ms 1884 KB Output is correct
4 Correct 95 ms 1876 KB Output is correct
5 Correct 81 ms 1884 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 421 ms 8148 KB Output is correct
2 Correct 430 ms 8148 KB Output is correct
3 Correct 433 ms 8148 KB Output is correct
4 Correct 503 ms 8148 KB Output is correct
5 Correct 434 ms 8148 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 368 ms 8148 KB Output is correct
2 Correct 489 ms 8148 KB Output is correct
3 Correct 360 ms 8148 KB Output is correct
4 Correct 483 ms 8148 KB Output is correct
5 Correct 431 ms 8148 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1097 ms 9684 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 470 ms 9708 KB Output is correct
2 Correct 567 ms 9684 KB Output is correct
3 Correct 467 ms 9808 KB Output is correct
4 Correct 559 ms 9684 KB Output is correct
5 Correct 499 ms 9700 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1076 ms 11220 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 613 ms 11220 KB Output is correct
2 Correct 665 ms 11220 KB Output is correct
3 Correct 511 ms 11220 KB Output is correct
4 Correct 683 ms 11272 KB Output is correct
5 Correct 617 ms 11276 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 670 ms 12836 KB Output is correct
2 Correct 616 ms 12876 KB Output is correct
3 Correct 655 ms 12756 KB Output is correct
4 Correct 736 ms 12756 KB Output is correct
5 Correct 683 ms 12844 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 620 ms 12836 KB Output is correct
2 Correct 745 ms 12844 KB Output is correct
3 Correct 571 ms 12876 KB Output is correct
4 Correct 728 ms 12840 KB Output is correct
5 Correct 681 ms 12836 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 881 ms 15996 KB Output is correct
2 Correct 853 ms 16076 KB Output is correct
3 Correct 773 ms 15956 KB Output is correct
4 Correct 931 ms 15972 KB Output is correct
5 Correct 863 ms 15976 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 780 ms 15988 KB Output is correct
2 Correct 952 ms 15972 KB Output is correct
3 Correct 772 ms 15976 KB Output is correct
4 Correct 979 ms 15980 KB Output is correct
5 Correct 864 ms 15968 KB Output is correct