Submission #798422

# Submission time Handle Problem Language Result Execution time Memory
798422 2023-07-30T17:02:31 Z trMatherz Mobile (BOI12_mobile) C++17
0 / 100
596 ms 15956 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-5 ){
        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 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 37 ms 1460 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 37 ms 1492 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 49 ms 1672 KB Output is correct
2 Incorrect 48 ms 1492 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 66 ms 1876 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 60 ms 1856 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 226 ms 8120 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 300 ms 8120 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 268 ms 9684 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 374 ms 9684 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 313 ms 11220 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 424 ms 11252 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 357 ms 12812 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 490 ms 12756 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 447 ms 15956 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 596 ms 15956 KB Output isn't correct
2 Halted 0 ms 0 KB -