Submission #906099

# Submission time Handle Problem Language Result Execution time Memory
906099 2024-01-13T13:55:35 Z Ludissey Mobile (BOI12_mobile) C++14
5 / 100
643 ms 31464 KB
#include <bits/stdc++.h>
using namespace std;
#define int double
 
double dist(double x1, double y1, double x2, double y2){
    double dist=sqrt(pow((x1-x2),2)+pow((y1-y2),2));
    return dist;
}

signed main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int N,L; cin >> N >> L;
    vector<pair<double,double>> a(N);
    for (int i = 0; i < N; i++){
        cin >> a[i].first >> a[i].second;
        a[i].second=abs(a[i].second);
    }
    int l=0,r=L;
    while(r-l>0.003){
        int mid=(l+r)/2;
        int rght=0;
        for (int i = 0; i < N; i++)
        {
            int pnt1=a[i].first-sqrt(pow(mid,2)-pow(a[i].second,2)),pnt2=a[i].first+sqrt(pow(mid,2)-pow(a[i].second,2));
            if(mid>=a[i].second){
                if(pnt1<=rght) rght=max(rght, pnt2);
            }
        }
        if(rght>=L) {
            r=mid;
        }else{
            l=mid;
        }
    }
    cout << setprecision(5) << fixed << (double)l << "\n";
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 1 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Incorrect 2 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 348 KB Output is correct
2 Correct 4 ms 348 KB Output is correct
3 Correct 3 ms 348 KB Output is correct
4 Incorrect 4 ms 604 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 344 KB Output is correct
2 Correct 3 ms 604 KB Output is correct
3 Incorrect 3 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 43 ms 1628 KB Output is correct
2 Correct 36 ms 2652 KB Output is correct
3 Correct 26 ms 1884 KB Output is correct
4 Correct 50 ms 2776 KB Output is correct
5 Incorrect 24 ms 1616 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 40 ms 1628 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 35 ms 1628 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 52 ms 1884 KB Output is correct
2 Correct 46 ms 1884 KB Output is correct
3 Correct 45 ms 2900 KB Output is correct
4 Incorrect 81 ms 3924 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 50 ms 1880 KB Output is correct
2 Correct 49 ms 3420 KB Output is correct
3 Correct 53 ms 2908 KB Output is correct
4 Correct 81 ms 3936 KB Output is correct
5 Correct 61 ms 3164 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 222 ms 8280 KB Output is correct
2 Incorrect 261 ms 8536 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 241 ms 8284 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 291 ms 9816 KB Output is correct
2 Incorrect 278 ms 9816 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 301 ms 9820 KB Output is correct
2 Correct 392 ms 9816 KB Output is correct
3 Incorrect 284 ms 16496 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 321 ms 11352 KB Output is correct
2 Correct 374 ms 11356 KB Output is correct
3 Incorrect 316 ms 11356 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 351 ms 11356 KB Output is correct
2 Incorrect 449 ms 11356 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 355 ms 12892 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 389 ms 12888 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 466 ms 15960 KB Output is correct
2 Correct 489 ms 31464 KB Output is correct
3 Incorrect 453 ms 30552 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 503 ms 15960 KB Output is correct
2 Incorrect 643 ms 15960 KB Output isn't correct
3 Halted 0 ms 0 KB -