답안 #513224

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
513224 2022-01-17T04:18:00 Z riverwalk3 Mobile (BOI12_mobile) C++14
0 / 100
1000 ms 25408 KB
#include <iostream>
#include <fstream>
#include <cmath>
#include <iomanip>
#define MAXN 1000100
using namespace std;
struct Beacon
{
    double x, y;
    Beacon()
    {
        x = y = 0;
    }
};
int N; double L;
Beacon b[MAXN];
bool judge(double R)
{
    double left_most_gap = 0;
    double l, r;
    for(int i=0; i<N; i++)
    {
        if(b[i].y > R)
        {
            continue;
        }
        else
        {
            l = b[i].x - sqrt(R*R-b[i].y*b[i].y);
            r = b[i].x + sqrt(R*R+b[i].y*b[i].y);
            if(l <= left_most_gap)
            {
                left_most_gap = max(left_most_gap, r);
            }
        }
    }
    if(left_most_gap >= L)
    {
        return true;
    }
    else
    {
        return false;
    }
}
int main()
{
    cin>>N>>L;
    for(int i=0; i<N; i++)
    {
        cin>>b[i].x>>b[i].y;
    }
    double lbound = 0; double hbound =  1.5e9; double avg;
    while(hbound - lbound > 1e-3)
    {
        avg = (lbound + hbound)/2;
        if(judge(avg))
        {
            hbound = avg;
        }
        else
        {
            lbound = avg;
        }
    }
    cout<<fixed<<setprecision(3)<<avg<<endl;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 15948 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 15948 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 15948 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 12 ms 15948 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 13 ms 15948 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 12 ms 15952 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 86 ms 15948 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 82 ms 15924 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 85 ms 15928 KB Output is correct
2 Correct 128 ms 15948 KB Output is correct
3 Correct 117 ms 16816 KB Output is correct
4 Incorrect 160 ms 17832 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 133 ms 15928 KB Output is correct
2 Correct 125 ms 15948 KB Output is correct
3 Correct 104 ms 15928 KB Output is correct
4 Incorrect 155 ms 15924 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 128 ms 15928 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 479 ms 15928 KB Output is correct
2 Correct 623 ms 23660 KB Output is correct
3 Correct 590 ms 23164 KB Output is correct
4 Incorrect 810 ms 25408 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 659 ms 15924 KB Output is correct
2 Incorrect 583 ms 15940 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 593 ms 15944 KB Output is correct
2 Correct 731 ms 15928 KB Output is correct
3 Correct 703 ms 15928 KB Output is correct
4 Incorrect 922 ms 15948 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 806 ms 15920 KB Output is correct
2 Incorrect 663 ms 15928 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 706 ms 15948 KB Output is correct
2 Correct 895 ms 15928 KB Output is correct
3 Correct 832 ms 16036 KB Output is correct
4 Execution timed out 1088 ms 15928 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 943 ms 15948 KB Output is correct
2 Incorrect 756 ms 15940 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 777 ms 15928 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1092 ms 15820 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 979 ms 15928 KB Output is correct
2 Execution timed out 1070 ms 16308 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1075 ms 17468 KB Time limit exceeded
2 Halted 0 ms 0 KB -