Submission #1035102

# Submission time Handle Problem Language Result Execution time Memory
1035102 2024-07-26T04:25:55 Z Uniq0rn Mobile (BOI12_mobile) C++14
42 / 100
457 ms 15964 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 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);
            }
        }
        if(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 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 0 ms 348 KB Output is correct
2 Correct 1 ms 344 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 344 KB Output is correct
3 Correct 2 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 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 3 ms 348 KB Output is correct
2 Incorrect 3 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 50 ms 1628 KB Output is correct
2 Correct 39 ms 1624 KB Output is correct
3 Correct 26 ms 1116 KB Output is correct
4 Correct 47 ms 1628 KB Output is correct
5 Correct 25 ms 1116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 42 ms 1624 KB Output is correct
2 Correct 41 ms 1372 KB Output is correct
3 Correct 48 ms 1628 KB Output is correct
4 Correct 56 ms 1624 KB Output is correct
5 Correct 57 ms 1624 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 38 ms 1624 KB Output is correct
2 Correct 34 ms 1628 KB Output is correct
3 Correct 39 ms 1628 KB Output is correct
4 Correct 68 ms 1880 KB Output is correct
5 Correct 51 ms 1628 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 42 ms 1884 KB Output is correct
2 Correct 42 ms 1884 KB Output is correct
3 Correct 43 ms 1884 KB Output is correct
4 Correct 69 ms 1884 KB Output is correct
5 Correct 66 ms 1884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 40 ms 1880 KB Output is correct
2 Correct 40 ms 1884 KB Output is correct
3 Correct 42 ms 1880 KB Output is correct
4 Correct 68 ms 1884 KB Output is correct
5 Correct 62 ms 1880 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 183 ms 8284 KB Output is correct
2 Incorrect 209 ms 8284 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 209 ms 8284 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 244 ms 9820 KB Output is correct
2 Correct 253 ms 9820 KB Output is correct
3 Correct 244 ms 9820 KB Output is correct
4 Correct 432 ms 9820 KB Output is correct
5 Correct 371 ms 9820 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 254 ms 9816 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 263 ms 11356 KB Output is correct
2 Correct 307 ms 11356 KB Output is correct
3 Incorrect 297 ms 11184 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 303 ms 11352 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 297 ms 12892 KB Output is correct
2 Correct 351 ms 12892 KB Output is correct
3 Incorrect 337 ms 12888 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 365 ms 12888 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 381 ms 15964 KB Output is correct
2 Correct 442 ms 15964 KB Output is correct
3 Incorrect 431 ms 15960 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 457 ms 15964 KB Output isn't correct
2 Halted 0 ms 0 KB -