Submission #963069

# Submission time Handle Problem Language Result Execution time Memory
963069 2024-04-14T12:54:32 Z alecurse Mobile (BOI12_mobile) C++14
8 / 100
1000 ms 63064 KB
#include <iostream>
#include <vector>
#include <math.h>
#define mp make_pair
#define double long double
using namespace std;
int N;
double L;
vector<pair<double,double> > points;
vector<pair<double,double> > segs;
bool test(double r) {
    for(int i=0;i<N;i++) {
        double x = points[i].first, y=points[i].second;
        double d = sqrt(r*r-y*y);
        segs[i].first=x-d;
        segs[i].second=x+d;
    }
    double left=0;
    for(int i=0;i<N;i++) {
        if(segs[i].first<=left) {
            left=max(left,segs[i].second);
        }
    }
    return left>=L;
}


int main() {
    cin>>N>>L;
    segs.resize(N);
    points.resize(N);
    for(int i=0;i<N;i++) {
        cin>>points[i].first>>points[i].second;
    }
    double a = 1, b=1e9;
    double res=1e9;
    while(abs(a-b)>=1e-5) {
        double k=(a+b)/2;
        if(test(k)) {
            res=min(res,k);
            b=k;
        } else {
            a=k;
        }
    }
    cout<<res;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 604 KB Output is correct
2 Correct 3 ms 600 KB Output is correct
3 Correct 3 ms 348 KB Output is correct
4 Incorrect 3 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 10 ms 604 KB Output is correct
2 Incorrect 7 ms 600 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 12 ms 604 KB Output is correct
2 Incorrect 6 ms 772 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 604 KB Output is correct
2 Incorrect 8 ms 604 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 121 ms 5120 KB Output is correct
2 Incorrect 104 ms 5212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 107 ms 5208 KB Output is correct
2 Correct 118 ms 4852 KB Output is correct
3 Incorrect 124 ms 5464 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 90 ms 5936 KB Output is correct
2 Incorrect 106 ms 5584 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 114 ms 6700 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 121 ms 6700 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 596 ms 31752 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 640 ms 31744 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 650 ms 38012 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 784 ms 38008 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 793 ms 44120 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 901 ms 44268 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 906 ms 50528 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1024 ms 50520 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1085 ms 63064 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1049 ms 62840 KB Time limit exceeded
2 Halted 0 ms 0 KB -