답안 #639205

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
639205 2022-09-09T00:53:25 Z Pietra Mobile (BOI12_mobile) C++14
75 / 100
1000 ms 15948 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) 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-6){
        mid = (ini + fim)/2 ;
        if(check(mid)) fim = mid ;
        else ini = mid ;
    }

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

}
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 340 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 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 340 KB Output is correct
2 Correct 9 ms 340 KB Output is correct
3 Correct 6 ms 340 KB Output is correct
4 Correct 6 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 340 KB Output is correct
2 Correct 5 ms 340 KB Output is correct
3 Correct 5 ms 340 KB Output is correct
4 Correct 8 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 340 KB Output is correct
2 Correct 6 ms 340 KB Output is correct
3 Correct 4 ms 336 KB Output is correct
4 Correct 7 ms 380 KB Output is correct
5 Correct 5 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 105 ms 1436 KB Output is correct
2 Correct 82 ms 1496 KB Output is correct
3 Correct 55 ms 1088 KB Output is correct
4 Correct 107 ms 1592 KB Output is correct
5 Correct 43 ms 972 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 93 ms 1492 KB Output is correct
2 Correct 74 ms 1332 KB Output is correct
3 Correct 87 ms 1468 KB Output is correct
4 Correct 94 ms 1452 KB Output is correct
5 Correct 111 ms 1544 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 79 ms 1604 KB Output is correct
2 Correct 114 ms 1476 KB Output is correct
3 Correct 82 ms 1608 KB Output is correct
4 Correct 136 ms 1788 KB Output is correct
5 Correct 92 ms 1692 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 122 ms 1756 KB Output is correct
2 Correct 119 ms 1812 KB Output is correct
3 Correct 97 ms 1876 KB Output is correct
4 Correct 166 ms 1944 KB Output is correct
5 Correct 108 ms 1840 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 132 ms 1832 KB Output is correct
2 Correct 107 ms 1756 KB Output is correct
3 Correct 96 ms 1828 KB Output is correct
4 Correct 137 ms 1868 KB Output is correct
5 Correct 134 ms 1768 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 427 ms 8024 KB Output is correct
2 Correct 620 ms 8144 KB Output is correct
3 Correct 546 ms 8124 KB Output is correct
4 Correct 699 ms 8060 KB Output is correct
5 Correct 574 ms 8008 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 576 ms 8180 KB Output is correct
2 Correct 621 ms 8040 KB Output is correct
3 Correct 534 ms 8120 KB Output is correct
4 Correct 675 ms 8088 KB Output is correct
5 Correct 621 ms 8096 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 544 ms 9828 KB Output is correct
2 Correct 710 ms 9640 KB Output is correct
3 Correct 714 ms 9696 KB Output is correct
4 Correct 895 ms 9784 KB Output is correct
5 Correct 697 ms 9708 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 780 ms 9688 KB Output is correct
2 Correct 765 ms 9688 KB Output is correct
3 Correct 603 ms 9816 KB Output is correct
4 Correct 856 ms 9688 KB Output is correct
5 Correct 714 ms 9772 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 638 ms 11272 KB Output is correct
2 Correct 807 ms 11256 KB Output is correct
3 Correct 759 ms 11284 KB Output is correct
4 Execution timed out 1033 ms 11292 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 817 ms 11284 KB Output is correct
2 Correct 865 ms 11256 KB Output is correct
3 Correct 735 ms 11296 KB Output is correct
4 Correct 967 ms 11248 KB Output is correct
5 Correct 855 ms 11212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 728 ms 12876 KB Output is correct
2 Correct 917 ms 12740 KB Output is correct
3 Correct 866 ms 12824 KB Output is correct
4 Execution timed out 1072 ms 12796 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 956 ms 12884 KB Output is correct
2 Correct 958 ms 12844 KB Output is correct
3 Correct 800 ms 12816 KB Output is correct
4 Execution timed out 1072 ms 12832 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 839 ms 15948 KB Output is correct
2 Execution timed out 1095 ms 15896 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1093 ms 15944 KB Time limit exceeded
2 Halted 0 ms 0 KB -