Submission #513219

# Submission time Handle Problem Language Result Execution time Memory
513219 2022-01-17T04:15:19 Z riverwalk3 Mobile (BOI12_mobile) C++14
0 / 100
1000 ms 31568 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 = L * 1.5; 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;
}
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 15824 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 15952 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 15968 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 15916 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 15952 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 15952 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 75 ms 16680 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 85 ms 16556 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 82 ms 16556 KB Output is correct
2 Incorrect 126 ms 17084 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 138 ms 17484 KB Output is correct
2 Correct 124 ms 17228 KB Output is correct
3 Correct 95 ms 16936 KB Output is correct
4 Incorrect 161 ms 17892 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 128 ms 17452 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 488 ms 20140 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 666 ms 24140 KB Output is correct
2 Incorrect 558 ms 22548 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 584 ms 21044 KB Output is correct
2 Correct 788 ms 25144 KB Output is correct
3 Correct 718 ms 24640 KB Output is correct
4 Incorrect 948 ms 27832 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 767 ms 25804 KB Output is correct
2 Incorrect 656 ms 23868 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 687 ms 21936 KB Output is correct
2 Correct 867 ms 26792 KB Output is correct
3 Correct 823 ms 26044 KB Output is correct
4 Execution timed out 1054 ms 29380 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 928 ms 27584 KB Output is correct
2 Incorrect 765 ms 25152 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 754 ms 22996 KB Output is correct
2 Correct 977 ms 28344 KB Output is correct
3 Correct 981 ms 27568 KB Output is correct
4 Execution timed out 1018 ms 31568 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1020 ms 29148 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 948 ms 24628 KB Output is correct
2 Execution timed out 1006 ms 31048 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1036 ms 30788 KB Time limit exceeded
2 Halted 0 ms 0 KB -