Submission #639206

# Submission time Handle Problem Language Result Execution time Memory
639206 2022-09-09T00:56:07 Z Pietra Mobile (BOI12_mobile) C++14
50 / 100
1000 ms 15984 KB
#include<bits/stdc++.h>
#define int long long
using namespace std ;

const int maxn = 2e6 + 5 ;
const int inf = 2e9 + 5 ;

double n, l, x[maxn], y[maxn] ;

bool check(double r){

    double f = 0 ;

    for(int i = 1 ; i <= n ; i++){
        double dx = sqrt(((r*r) - (y[i]*y[i]))) ;
        double ini = x[i] - dx, fim = x[i] + dx ;
        if(ini <= f) f = max(f, fim) ;
    }

    return (f >= l) ;
}

int32_t main(){

    cin >> n >> l ;

    for(int i = 1 ; i <= n ; i++) cin >> x[i] >> y[i] ;

    double ini = 0, fim = inf*1.000, mid ;

    while(fim - ini > 1e-3){
        mid = (ini + fim)/2 ;
        if(check(mid)) fim = mid ;
        else ini = mid ;
    }

    cout << fixed << setprecision(3) << fim << "\n" ;

}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 4 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 340 KB Output is correct
2 Correct 6 ms 340 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 7 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 340 KB Output is correct
2 Correct 6 ms 340 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 6 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 340 KB Output is correct
2 Correct 6 ms 468 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 6 ms 340 KB Output is correct
5 Correct 5 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 84 ms 1468 KB Output is correct
2 Correct 87 ms 1496 KB Output is correct
3 Incorrect 50 ms 1080 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 76 ms 1476 KB Output is correct
2 Correct 77 ms 1276 KB Output is correct
3 Correct 87 ms 1484 KB Output is correct
4 Incorrect 92 ms 1532 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 73 ms 1564 KB Output is correct
2 Correct 87 ms 1528 KB Output is correct
3 Incorrect 84 ms 1680 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 114 ms 1852 KB Output is correct
2 Correct 108 ms 1764 KB Output is correct
3 Incorrect 93 ms 1792 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 113 ms 1868 KB Output is correct
2 Correct 102 ms 1740 KB Output is correct
3 Correct 89 ms 1856 KB Output is correct
4 Correct 131 ms 1840 KB Output is correct
5 Correct 114 ms 1740 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 409 ms 8120 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 630 ms 8196 KB Output is correct
2 Correct 576 ms 8024 KB Output is correct
3 Correct 465 ms 8156 KB Output is correct
4 Correct 681 ms 8148 KB Output is correct
5 Incorrect 549 ms 8132 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 499 ms 9688 KB Output is correct
2 Correct 723 ms 9764 KB Output is correct
3 Correct 639 ms 9744 KB Output is correct
4 Correct 824 ms 9672 KB Output is correct
5 Correct 645 ms 9692 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 687 ms 9768 KB Output is correct
2 Correct 677 ms 9784 KB Output is correct
3 Correct 580 ms 9648 KB Output is correct
4 Correct 816 ms 9784 KB Output is correct
5 Correct 727 ms 9652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 586 ms 11208 KB Output is correct
2 Correct 769 ms 11268 KB Output is correct
3 Correct 749 ms 11240 KB Output is correct
4 Correct 949 ms 11196 KB Output is correct
5 Correct 747 ms 11264 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 791 ms 11176 KB Output is correct
2 Correct 802 ms 11300 KB Output is correct
3 Correct 677 ms 11256 KB Output is correct
4 Correct 924 ms 11252 KB Output is correct
5 Correct 822 ms 11336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 706 ms 12788 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 939 ms 12972 KB Output is correct
2 Correct 906 ms 12764 KB Output is correct
3 Correct 753 ms 12772 KB Output is correct
4 Execution timed out 1083 ms 13012 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 936 ms 15892 KB Output is correct
2 Execution timed out 1086 ms 15948 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1092 ms 15984 KB Time limit exceeded
2 Halted 0 ms 0 KB -