답안 #639200

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
639200 2022-09-09T00:35:10 Z Pietra Mobile (BOI12_mobile) C++14
80 / 100
1000 ms 16192 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.00, mid ;
    int ct = 45 ;

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

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

}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 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
# 결과 실행 시간 메모리 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 2 ms 340 KB Output is correct
2 Correct 3 ms 312 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 3 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 4 ms 340 KB Output is correct
4 Correct 8 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 388 KB Output is correct
2 Correct 6 ms 344 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 6 ms 340 KB Output is correct
# 결과 실행 시간 메모리 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 8 ms 340 KB Output is correct
5 Correct 4 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 80 ms 1472 KB Output is correct
2 Correct 81 ms 1408 KB Output is correct
3 Correct 52 ms 1100 KB Output is correct
4 Correct 100 ms 1368 KB Output is correct
5 Correct 43 ms 1048 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 74 ms 1524 KB Output is correct
2 Correct 70 ms 1348 KB Output is correct
3 Correct 86 ms 1528 KB Output is correct
4 Correct 111 ms 1628 KB Output is correct
5 Correct 113 ms 1620 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 70 ms 1560 KB Output is correct
2 Correct 95 ms 1492 KB Output is correct
3 Correct 82 ms 1600 KB Output is correct
4 Correct 143 ms 1740 KB Output is correct
5 Correct 84 ms 1648 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 141 ms 1856 KB Output is correct
2 Correct 109 ms 1824 KB Output is correct
3 Correct 105 ms 1748 KB Output is correct
4 Correct 156 ms 1792 KB Output is correct
5 Correct 117 ms 1756 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 128 ms 1808 KB Output is correct
2 Correct 117 ms 1864 KB Output is correct
3 Correct 98 ms 1788 KB Output is correct
4 Correct 149 ms 1892 KB Output is correct
5 Correct 108 ms 1960 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 427 ms 8120 KB Output is correct
2 Correct 557 ms 8124 KB Output is correct
3 Correct 561 ms 8012 KB Output is correct
4 Correct 709 ms 8124 KB Output is correct
5 Correct 563 ms 8112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 606 ms 8388 KB Output is correct
2 Correct 607 ms 8180 KB Output is correct
3 Correct 480 ms 8012 KB Output is correct
4 Correct 693 ms 8068 KB Output is correct
5 Correct 592 ms 8052 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 505 ms 9676 KB Output is correct
2 Correct 682 ms 9728 KB Output is correct
3 Correct 651 ms 9696 KB Output is correct
4 Correct 850 ms 9824 KB Output is correct
5 Correct 645 ms 9688 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 702 ms 9856 KB Output is correct
2 Correct 671 ms 9692 KB Output is correct
3 Correct 561 ms 9704 KB Output is correct
4 Correct 809 ms 9756 KB Output is correct
5 Correct 674 ms 9840 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 563 ms 11328 KB Output is correct
2 Correct 759 ms 11264 KB Output is correct
3 Correct 724 ms 11204 KB Output is correct
4 Correct 927 ms 11244 KB Output is correct
5 Correct 728 ms 11644 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 798 ms 11512 KB Output is correct
2 Correct 789 ms 11284 KB Output is correct
3 Correct 669 ms 11248 KB Output is correct
4 Correct 917 ms 11244 KB Output is correct
5 Correct 785 ms 11264 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 653 ms 12820 KB Output is correct
2 Correct 857 ms 12804 KB Output is correct
3 Correct 829 ms 12796 KB Output is correct
4 Execution timed out 1064 ms 12864 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 900 ms 13020 KB Output is correct
2 Correct 881 ms 12876 KB Output is correct
3 Correct 744 ms 12740 KB Output is correct
4 Execution timed out 1050 ms 12736 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 818 ms 16192 KB Output is correct
2 Execution timed out 1068 ms 15844 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1025 ms 16144 KB Time limit exceeded
2 Halted 0 ms 0 KB -