Submission #798419

# Submission time Handle Problem Language Result Execution time Memory
798419 2023-07-30T17:01:18 Z trMatherz Mobile (BOI12_mobile) C++17
0 / 100
681 ms 32480 KB
# include <numeric>
# include <vector>
# include <algorithm>
# include <cmath>
# include <array>
# include <bitset>
# include <set>
# include <map>
# include <string>
# include <cstdlib>
# include <queue>
# include <iomanip>

using namespace std;
#define ll long long int
#define all(x) x.begin(), x.end()
#define f x.first
#define s x.second


     # include <iostream>

/*
# include <fstream>
 ifstream cin ("angry.in");
 ofstream cout ("angry.out");
*/

/*

1 3 8 10 11
 2 5 2 1
 
 */



int main(){
    int n, k;
    cin >> n >> k;
    vector<array<ll, 2>> a(n);
    for(int i = 0; i < n; i++){
        cin >> a[i][0] >> a[i][1];
    }
    auto cf = [&](double m){
        double cur = 0;
        for(int i = 0; i < n; i++){
            double d = sqrt(m*m + a[i][1]*a[i][1]);
            double e1 = a[i][0] - d, e2 = a[i][0] + d;
            if(e1 <= cur){cur = max(cur, e2);}
        }
        if(cur >= k){return false;}
        return true;
    };
    double l = 0, r = 1e9;
    while(r - l > 1e-3 ){
        double m = l + (r-l)/2.0;
        if(cf(m)){l = m;}
        else{r = m;}
    }
    cout << l;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 316 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 312 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 37 ms 2256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 2260 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 39 ms 2348 KB Output is correct
2 Incorrect 60 ms 2736 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 60 ms 3384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 59 ms 3372 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 216 ms 12328 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 295 ms 16336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 300 ms 14916 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 375 ms 19544 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 318 ms 17256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 482 ms 22776 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 362 ms 19720 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 494 ms 26000 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 446 ms 24644 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 681 ms 32480 KB Output isn't correct
2 Halted 0 ms 0 KB -