Submission #639203

# Submission time Handle Problem Language Result Execution time Memory
639203 2022-09-09T00:40:35 Z Pietra Mobile (BOI12_mobile) C++14
80 / 100
1000 ms 16008 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 = 51 ;

    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 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 340 KB Output is correct
2 Correct 3 ms 340 KB Output is correct
3 Correct 2 ms 344 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 340 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 6 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 392 KB Output is correct
2 Correct 6 ms 340 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 8 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 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 4 ms 396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 82 ms 1468 KB Output is correct
2 Correct 89 ms 1484 KB Output is correct
3 Correct 53 ms 1136 KB Output is correct
4 Correct 99 ms 1472 KB Output is correct
5 Correct 43 ms 964 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 75 ms 1496 KB Output is correct
2 Correct 73 ms 1392 KB Output is correct
3 Correct 91 ms 1548 KB Output is correct
4 Correct 97 ms 1548 KB Output is correct
5 Correct 116 ms 1596 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 72 ms 1556 KB Output is correct
2 Correct 91 ms 1584 KB Output is correct
3 Correct 84 ms 1632 KB Output is correct
4 Correct 141 ms 1796 KB Output is correct
5 Correct 89 ms 1600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 115 ms 1824 KB Output is correct
2 Correct 108 ms 1820 KB Output is correct
3 Correct 102 ms 1896 KB Output is correct
4 Correct 139 ms 1836 KB Output is correct
5 Correct 108 ms 1868 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 114 ms 1740 KB Output is correct
2 Correct 108 ms 1760 KB Output is correct
3 Correct 98 ms 1932 KB Output is correct
4 Correct 140 ms 1904 KB Output is correct
5 Correct 108 ms 1768 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 432 ms 8044 KB Output is correct
2 Correct 562 ms 8008 KB Output is correct
3 Correct 567 ms 8136 KB Output is correct
4 Correct 689 ms 8308 KB Output is correct
5 Correct 572 ms 8112 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 603 ms 8200 KB Output is correct
2 Correct 625 ms 8120 KB Output is correct
3 Correct 483 ms 8028 KB Output is correct
4 Correct 663 ms 8124 KB Output is correct
5 Correct 581 ms 8272 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 515 ms 9800 KB Output is correct
2 Correct 668 ms 9672 KB Output is correct
3 Correct 648 ms 9588 KB Output is correct
4 Correct 827 ms 9856 KB Output is correct
5 Correct 656 ms 9816 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 699 ms 9676 KB Output is correct
2 Correct 728 ms 9652 KB Output is correct
3 Correct 588 ms 9712 KB Output is correct
4 Correct 816 ms 9804 KB Output is correct
5 Correct 691 ms 9820 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 604 ms 11252 KB Output is correct
2 Correct 804 ms 11324 KB Output is correct
3 Correct 764 ms 11180 KB Output is correct
4 Correct 940 ms 11376 KB Output is correct
5 Correct 753 ms 11324 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 827 ms 11164 KB Output is correct
2 Correct 850 ms 11296 KB Output is correct
3 Correct 690 ms 11152 KB Output is correct
4 Correct 942 ms 11320 KB Output is correct
5 Correct 807 ms 11284 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 703 ms 12892 KB Output is correct
2 Correct 916 ms 13016 KB Output is correct
3 Correct 879 ms 12876 KB Output is correct
4 Execution timed out 1079 ms 12704 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 935 ms 12844 KB Output is correct
2 Correct 936 ms 12920 KB Output is correct
3 Correct 798 ms 13088 KB Output is correct
4 Execution timed out 1086 ms 12800 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 857 ms 15952 KB Output is correct
2 Execution timed out 1097 ms 15936 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1089 ms 16008 KB Time limit exceeded
2 Halted 0 ms 0 KB -