Submission #1035104

# Submission time Handle Problem Language Result Execution time Memory
1035104 2024-07-26T04:28:31 Z Uniq0rn Mobile (BOI12_mobile) C++14
100 / 100
706 ms 35412 KB
#include <bits/stdc++.h>
using namespace std;
 
#define ld long double 
#define ll long long int
#define pi pair<int,int>
#define sz(x) (int)x.size()
#define all(x) begin(x),end(x)
 
int main()
{
    cin.tie(0)->sync_with_stdio(0);
    int n;
    double L;
    cin >> n >> L;
    vector<pair<double,double>> a(n);
    for(int i=0;i<n;i++){
        cin >> a[i].first >> a[i].second;
    }
    sort(all(a));
    auto len = [&](double a,double b){
        return sqrt(a*a - b*b);
    };
    double l = 0,r = 2e9;
    while(r - l > 0.000001){
        double mid = (l + r) / 2.0;
        double mn = 0,mx = 0;
        for(int i=0;i<n;i++){
            double le = a[i].first - len(mid,a[i].second),ri = a[i].first + len(mid,a[i].second);
            if(le <= mx){
                mx = max(mx,ri);
                mn = min(mn,le);
            }
        }
        if(mn <= 0 && mx >= L){
            r = mid;
        }
        else{
            l = mid;
        }
    }
    cout << setprecision(6) << fixed << r;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 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 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 3 ms 344 KB Output is correct
4 Correct 4 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 344 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 3 ms 348 KB Output is correct
4 Correct 4 ms 608 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 3 ms 348 KB Output is correct
3 Correct 3 ms 344 KB Output is correct
4 Correct 4 ms 604 KB Output is correct
5 Correct 3 ms 472 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 49 ms 1628 KB Output is correct
2 Correct 33 ms 1624 KB Output is correct
3 Correct 25 ms 1112 KB Output is correct
4 Correct 55 ms 1628 KB Output is correct
5 Correct 27 ms 1112 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 43 ms 1628 KB Output is correct
2 Correct 43 ms 1372 KB Output is correct
3 Correct 51 ms 1624 KB Output is correct
4 Correct 52 ms 1628 KB Output is correct
5 Correct 60 ms 1628 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 35 ms 1624 KB Output is correct
2 Correct 39 ms 1628 KB Output is correct
3 Correct 38 ms 1628 KB Output is correct
4 Correct 73 ms 1884 KB Output is correct
5 Correct 52 ms 1624 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 45 ms 1884 KB Output is correct
2 Correct 42 ms 1880 KB Output is correct
3 Correct 44 ms 1884 KB Output is correct
4 Correct 66 ms 1884 KB Output is correct
5 Correct 62 ms 1880 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 43 ms 1884 KB Output is correct
2 Correct 43 ms 1884 KB Output is correct
3 Correct 45 ms 1884 KB Output is correct
4 Correct 71 ms 1880 KB Output is correct
5 Correct 62 ms 1880 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 193 ms 8284 KB Output is correct
2 Correct 218 ms 8280 KB Output is correct
3 Correct 207 ms 15428 KB Output is correct
4 Correct 358 ms 17920 KB Output is correct
5 Correct 314 ms 14932 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 229 ms 8280 KB Output is correct
2 Correct 365 ms 14676 KB Output is correct
3 Correct 228 ms 13908 KB Output is correct
4 Correct 341 ms 17480 KB Output is correct
5 Correct 318 ms 15444 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 235 ms 9816 KB Output is correct
2 Correct 263 ms 9816 KB Output is correct
3 Correct 269 ms 9816 KB Output is correct
4 Correct 434 ms 9820 KB Output is correct
5 Correct 381 ms 9816 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 277 ms 9820 KB Output is correct
2 Correct 426 ms 17748 KB Output is correct
3 Correct 279 ms 16468 KB Output is correct
4 Correct 440 ms 21584 KB Output is correct
5 Correct 387 ms 18536 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 286 ms 11356 KB Output is correct
2 Correct 300 ms 11356 KB Output is correct
3 Correct 305 ms 11352 KB Output is correct
4 Correct 480 ms 24912 KB Output is correct
5 Correct 436 ms 20304 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 309 ms 11356 KB Output is correct
2 Correct 482 ms 20620 KB Output is correct
3 Correct 325 ms 19724 KB Output is correct
4 Correct 509 ms 24660 KB Output is correct
5 Correct 468 ms 21380 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 314 ms 12892 KB Output is correct
2 Correct 366 ms 12892 KB Output is correct
3 Correct 338 ms 12892 KB Output is correct
4 Correct 591 ms 28580 KB Output is correct
5 Correct 509 ms 23980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 360 ms 12888 KB Output is correct
2 Correct 562 ms 23376 KB Output is correct
3 Correct 364 ms 22468 KB Output is correct
4 Correct 575 ms 28244 KB Output is correct
5 Correct 537 ms 24404 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 396 ms 15964 KB Output is correct
2 Correct 452 ms 15960 KB Output is correct
3 Correct 423 ms 15960 KB Output is correct
4 Correct 683 ms 35152 KB Output is correct
5 Correct 644 ms 29668 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 459 ms 15960 KB Output is correct
2 Correct 676 ms 29164 KB Output is correct
3 Correct 461 ms 28256 KB Output is correct
4 Correct 706 ms 35412 KB Output is correct
5 Correct 672 ms 30800 KB Output is correct