답안 #639216

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
639216 2022-09-09T02:30:23 Z Pietra Mobile (BOI12_mobile) C++14
4 / 100
1000 ms 15936 KB
#include<bits/stdc++.h>
using namespace std ;

const int maxn = 2e6 + 5 ;
const double inf = 2e9 + 5 ;

double n, l, x[maxn], y[maxn] ;

bool check(double r){

    double f = 0 ;

    for(int i = 1 ; i <= n ; i++){
        if(r < y[i]) continue ;
        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) ;
}

int main(){

    cin >> n >> l ;

    for(int i = 1 ; i <= n ; i++) cin >> x[i] >> y[i] ;

    double ini = 0, fim = inf, mid ;

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

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

}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 396 KB Output is correct
2 Correct 6 ms 340 KB Output is correct
3 Correct 5 ms 468 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 7 ms 384 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Incorrect 8 ms 340 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 340 KB Output is correct
2 Correct 6 ms 340 KB Output is correct
3 Incorrect 4 ms 340 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 72 ms 1416 KB Output is correct
2 Correct 85 ms 1416 KB Output is correct
3 Incorrect 53 ms 1112 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 70 ms 1484 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 69 ms 1696 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 115 ms 1756 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 136 ms 1860 KB Output is correct
2 Incorrect 113 ms 1788 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 415 ms 8120 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 574 ms 8080 KB Output is correct
2 Incorrect 558 ms 8076 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 493 ms 9612 KB Output is correct
2 Incorrect 674 ms 9640 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 696 ms 9692 KB Output is correct
2 Correct 679 ms 9688 KB Output is correct
3 Incorrect 557 ms 9600 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 573 ms 11264 KB Output is correct
2 Correct 769 ms 11188 KB Output is correct
3 Incorrect 763 ms 11216 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 802 ms 11260 KB Output is correct
2 Correct 735 ms 11176 KB Output is correct
3 Correct 654 ms 11256 KB Output is correct
4 Execution timed out 1014 ms 11368 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 665 ms 12704 KB Output is correct
2 Correct 885 ms 12820 KB Output is correct
3 Correct 856 ms 12920 KB Output is correct
4 Execution timed out 1095 ms 12844 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 961 ms 12752 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 832 ms 15904 KB Output is correct
2 Execution timed out 1087 ms 15892 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1085 ms 15936 KB Time limit exceeded
2 Halted 0 ms 0 KB -