Submission #1035101

# Submission time Handle Problem Language Result Execution time Memory
1035101 2024-07-26T04:24:56 Z Uniq0rn Mobile (BOI12_mobile) C++14
42 / 100
478 ms 32436 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=1;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 344 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 344 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 4 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 344 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 3 ms 344 KB Output is correct
2 Incorrect 2 ms 604 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 3 ms 604 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 48 ms 2396 KB Output is correct
2 Correct 33 ms 2648 KB Output is correct
3 Correct 24 ms 1880 KB Output is correct
4 Correct 49 ms 2648 KB Output is correct
5 Correct 26 ms 1628 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 44 ms 2424 KB Output is correct
2 Correct 51 ms 2192 KB Output is correct
3 Correct 51 ms 2652 KB Output is correct
4 Correct 52 ms 2972 KB Output is correct
5 Correct 58 ms 3160 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 33 ms 2392 KB Output is correct
2 Correct 35 ms 2908 KB Output is correct
3 Correct 38 ms 2648 KB Output is correct
4 Correct 63 ms 3920 KB Output is correct
5 Correct 44 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 36 ms 3420 KB Output is correct
2 Correct 39 ms 3292 KB Output is correct
3 Correct 37 ms 2904 KB Output is correct
4 Correct 68 ms 3924 KB Output is correct
5 Correct 62 ms 3160 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 44 ms 3416 KB Output is correct
2 Correct 43 ms 3408 KB Output is correct
3 Correct 47 ms 2908 KB Output is correct
4 Correct 89 ms 3928 KB Output is correct
5 Correct 63 ms 3280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 200 ms 12372 KB Output is correct
2 Incorrect 232 ms 15952 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 220 ms 16468 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 241 ms 14928 KB Output is correct
2 Correct 265 ms 19028 KB Output is correct
3 Correct 256 ms 18516 KB Output is correct
4 Correct 468 ms 21692 KB Output is correct
5 Correct 377 ms 17780 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 264 ms 19440 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 292 ms 17232 KB Output is correct
2 Correct 311 ms 22096 KB Output is correct
3 Incorrect 301 ms 21396 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 326 ms 22904 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 308 ms 19792 KB Output is correct
2 Correct 379 ms 25332 KB Output is correct
3 Incorrect 356 ms 24404 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 371 ms 26056 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 393 ms 24656 KB Output is correct
2 Correct 438 ms 31452 KB Output is correct
3 Incorrect 478 ms 30432 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 451 ms 32436 KB Output isn't correct
2 Halted 0 ms 0 KB -