Submission #639198

# Submission time Handle Problem Language Result Execution time Memory
639198 2022-09-09T00:33:22 Z Pietra Mobile (BOI12_mobile) C++14
80 / 100
1000 ms 16588 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.00, mid ;
    int ct = 44 ;

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

    cout << fixed << setprecision(5) << 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 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 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 3 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 5 ms 360 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 340 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 7 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 340 KB Output is correct
2 Correct 7 ms 340 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 7 ms 340 KB Output is correct
5 Correct 4 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 86 ms 1368 KB Output is correct
2 Correct 88 ms 1380 KB Output is correct
3 Correct 51 ms 1136 KB Output is correct
4 Correct 91 ms 1400 KB Output is correct
5 Correct 41 ms 1084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 76 ms 1484 KB Output is correct
2 Correct 78 ms 1472 KB Output is correct
3 Correct 88 ms 1456 KB Output is correct
4 Correct 98 ms 1464 KB Output is correct
5 Correct 108 ms 1576 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 68 ms 1584 KB Output is correct
2 Correct 90 ms 1484 KB Output is correct
3 Correct 82 ms 1524 KB Output is correct
4 Correct 137 ms 1820 KB Output is correct
5 Correct 85 ms 1696 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 113 ms 1788 KB Output is correct
2 Correct 106 ms 1844 KB Output is correct
3 Correct 95 ms 1780 KB Output is correct
4 Correct 141 ms 1860 KB Output is correct
5 Correct 109 ms 1788 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 113 ms 1776 KB Output is correct
2 Correct 108 ms 1864 KB Output is correct
3 Correct 106 ms 1840 KB Output is correct
4 Correct 154 ms 1868 KB Output is correct
5 Correct 124 ms 1872 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 420 ms 8120 KB Output is correct
2 Correct 574 ms 8124 KB Output is correct
3 Correct 575 ms 8068 KB Output is correct
4 Correct 702 ms 8048 KB Output is correct
5 Correct 572 ms 8116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 591 ms 8588 KB Output is correct
2 Correct 616 ms 8052 KB Output is correct
3 Correct 512 ms 8120 KB Output is correct
4 Correct 671 ms 8128 KB Output is correct
5 Correct 580 ms 8120 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 503 ms 9688 KB Output is correct
2 Correct 696 ms 9724 KB Output is correct
3 Correct 654 ms 9696 KB Output is correct
4 Correct 847 ms 9592 KB Output is correct
5 Correct 654 ms 9644 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 721 ms 10208 KB Output is correct
2 Correct 715 ms 9696 KB Output is correct
3 Correct 590 ms 9676 KB Output is correct
4 Correct 813 ms 9644 KB Output is correct
5 Correct 678 ms 9708 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 564 ms 11260 KB Output is correct
2 Correct 743 ms 11168 KB Output is correct
3 Correct 725 ms 11268 KB Output is correct
4 Correct 916 ms 11308 KB Output is correct
5 Correct 727 ms 12444 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 781 ms 11756 KB Output is correct
2 Correct 790 ms 11152 KB Output is correct
3 Correct 666 ms 11256 KB Output is correct
4 Correct 903 ms 11260 KB Output is correct
5 Correct 769 ms 11340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 639 ms 12720 KB Output is correct
2 Correct 849 ms 12800 KB Output is correct
3 Correct 821 ms 12896 KB Output is correct
4 Execution timed out 1051 ms 12816 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 903 ms 13380 KB Output is correct
2 Correct 902 ms 12876 KB Output is correct
3 Correct 855 ms 12748 KB Output is correct
4 Execution timed out 1054 ms 12876 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 806 ms 16588 KB Output is correct
2 Execution timed out 1071 ms 15948 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1057 ms 16392 KB Time limit exceeded
2 Halted 0 ms 0 KB -