Submission #639202

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

const int maxn = 2e6 + 5 ;
const int inf = 2e10 + 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 + 1e-9) f = max(f, fim) ;
    }

    return (f + 1e-9 >= 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 ;
    int ct = 45 ;

    while(ct--){
        mid = (ini + fim)/2 ;
        if(check(mid)) fim = mid ;
        else ini = mid ;
    }

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

}
# 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 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 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 4 ms 352 KB Output is correct
2 Correct 3 ms 340 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 3 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 340 KB Output is correct
2 Correct 6 ms 384 KB Output is correct
3 Correct 5 ms 340 KB Output is correct
4 Correct 7 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 340 KB Output is correct
2 Correct 7 ms 392 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 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
5 Correct 5 ms 368 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 80 ms 1464 KB Output is correct
2 Correct 83 ms 1384 KB Output is correct
3 Correct 52 ms 1108 KB Output is correct
4 Correct 92 ms 1356 KB Output is correct
5 Correct 42 ms 1020 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 77 ms 1520 KB Output is correct
2 Correct 81 ms 1372 KB Output is correct
3 Correct 104 ms 1608 KB Output is correct
4 Correct 117 ms 1540 KB Output is correct
5 Correct 110 ms 1588 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 71 ms 1660 KB Output is correct
2 Correct 107 ms 1484 KB Output is correct
3 Correct 90 ms 1508 KB Output is correct
4 Correct 136 ms 1756 KB Output is correct
5 Correct 86 ms 1584 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 112 ms 1752 KB Output is correct
2 Correct 114 ms 1780 KB Output is correct
3 Correct 105 ms 1748 KB Output is correct
4 Correct 135 ms 1840 KB Output is correct
5 Correct 114 ms 1836 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 118 ms 1748 KB Output is correct
2 Correct 125 ms 1776 KB Output is correct
3 Correct 96 ms 1796 KB Output is correct
4 Correct 149 ms 1864 KB Output is correct
5 Correct 112 ms 1740 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 434 ms 8128 KB Output is correct
2 Correct 593 ms 8208 KB Output is correct
3 Correct 544 ms 8048 KB Output is correct
4 Correct 681 ms 8112 KB Output is correct
5 Correct 562 ms 8124 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 594 ms 8012 KB Output is correct
2 Correct 614 ms 8140 KB Output is correct
3 Correct 502 ms 8064 KB Output is correct
4 Correct 670 ms 8120 KB Output is correct
5 Correct 575 ms 8120 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 558 ms 9600 KB Output is correct
2 Correct 705 ms 9688 KB Output is correct
3 Correct 676 ms 10008 KB Output is correct
4 Correct 853 ms 9696 KB Output is correct
5 Correct 671 ms 9676 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 694 ms 9612 KB Output is correct
2 Correct 733 ms 9668 KB Output is correct
3 Correct 579 ms 9748 KB Output is correct
4 Correct 850 ms 9708 KB Output is correct
5 Correct 690 ms 9696 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 595 ms 11212 KB Output is correct
2 Correct 822 ms 11148 KB Output is correct
3 Correct 754 ms 11256 KB Output is correct
4 Correct 972 ms 11316 KB Output is correct
5 Correct 756 ms 11240 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 821 ms 11328 KB Output is correct
2 Correct 802 ms 11236 KB Output is correct
3 Correct 684 ms 11388 KB Output is correct
4 Correct 929 ms 11364 KB Output is correct
5 Correct 814 ms 11256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 672 ms 13016 KB Output is correct
2 Correct 902 ms 12820 KB Output is correct
3 Correct 871 ms 12876 KB Output is correct
4 Execution timed out 1085 ms 12836 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 919 ms 13044 KB Output is correct
2 Execution timed out 1043 ms 12784 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 880 ms 16060 KB Output is correct
2 Execution timed out 1089 ms 15940 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1082 ms 15932 KB Time limit exceeded
2 Halted 0 ms 0 KB -