답안 #493543

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
493543 2021-12-11T22:29:40 Z imaginary_unit Mobile (BOI12_mobile) C++17
100 / 100
417 ms 17228 KB
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;

ll n, len, x[1'000'000], y[1'000'000];

bool ok(double r)
{
    double cur=0;
    for(int i=0; i<n; i++){
        double delta=sqrt(r*r-y[i]*y[i]), a=x[i]-delta, b=x[i]+delta;
        if(a<=cur){
            cur=max(cur, b);
        }
    }
    return cur >= len;
}

double MinRadius(double l, double r)
{
    while(r-l>1e-4){
        double m=(l+r)/2;
        if(ok(m)){
            r=m;
        }
        else{
            l=m;
        }
    }
    return r;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n >> len;
    for(int i=0; i<n; i++){
        cin >> x[i] >> y[i];
    }
    cout << fixed << setprecision(4) << MinRadius(0, 1.5e9);
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 332 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 324 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 316 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 332 KB Output is correct
2 Correct 2 ms 460 KB Output is correct
3 Correct 2 ms 332 KB Output is correct
4 Correct 2 ms 460 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 460 KB Output is correct
2 Correct 2 ms 460 KB Output is correct
3 Correct 3 ms 332 KB Output is correct
4 Correct 2 ms 460 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 460 KB Output is correct
2 Correct 2 ms 404 KB Output is correct
3 Correct 2 ms 332 KB Output is correct
4 Correct 2 ms 460 KB Output is correct
5 Correct 2 ms 328 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 1788 KB Output is correct
2 Correct 23 ms 1928 KB Output is correct
3 Correct 14 ms 1484 KB Output is correct
4 Correct 29 ms 1980 KB Output is correct
5 Correct 13 ms 1356 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 25 ms 1868 KB Output is correct
2 Correct 23 ms 1752 KB Output is correct
3 Correct 26 ms 1860 KB Output is correct
4 Correct 26 ms 1860 KB Output is correct
5 Correct 30 ms 2156 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 1996 KB Output is correct
2 Correct 24 ms 2072 KB Output is correct
3 Correct 24 ms 2108 KB Output is correct
4 Correct 39 ms 2424 KB Output is correct
5 Correct 28 ms 2060 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 33 ms 2596 KB Output is correct
2 Correct 29 ms 2360 KB Output is correct
3 Correct 27 ms 2380 KB Output is correct
4 Correct 38 ms 2684 KB Output is correct
5 Correct 33 ms 2264 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 2564 KB Output is correct
2 Correct 29 ms 2328 KB Output is correct
3 Correct 27 ms 2380 KB Output is correct
4 Correct 37 ms 2428 KB Output is correct
5 Correct 36 ms 2244 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 125 ms 8868 KB Output is correct
2 Correct 159 ms 8820 KB Output is correct
3 Correct 146 ms 8772 KB Output is correct
4 Correct 177 ms 8812 KB Output is correct
5 Correct 157 ms 8820 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 150 ms 9284 KB Output is correct
2 Correct 238 ms 8880 KB Output is correct
3 Correct 142 ms 8812 KB Output is correct
4 Correct 191 ms 8932 KB Output is correct
5 Correct 179 ms 8772 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 149 ms 10440 KB Output is correct
2 Correct 172 ms 10316 KB Output is correct
3 Correct 167 ms 10392 KB Output is correct
4 Correct 218 ms 10584 KB Output is correct
5 Correct 190 ms 10384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 184 ms 10992 KB Output is correct
2 Correct 276 ms 10488 KB Output is correct
3 Correct 158 ms 10424 KB Output is correct
4 Correct 212 ms 10608 KB Output is correct
5 Correct 198 ms 10380 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 170 ms 11936 KB Output is correct
2 Correct 213 ms 11948 KB Output is correct
3 Correct 198 ms 11996 KB Output is correct
4 Correct 249 ms 12336 KB Output is correct
5 Correct 221 ms 11960 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 231 ms 12484 KB Output is correct
2 Correct 305 ms 12056 KB Output is correct
3 Correct 185 ms 12036 KB Output is correct
4 Correct 248 ms 12356 KB Output is correct
5 Correct 219 ms 11872 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 194 ms 13536 KB Output is correct
2 Correct 238 ms 13672 KB Output is correct
3 Correct 227 ms 13688 KB Output is correct
4 Correct 285 ms 13960 KB Output is correct
5 Correct 265 ms 13376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 238 ms 14060 KB Output is correct
2 Correct 340 ms 13540 KB Output is correct
3 Correct 220 ms 13568 KB Output is correct
4 Correct 284 ms 13896 KB Output is correct
5 Correct 258 ms 13460 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 280 ms 17180 KB Output is correct
2 Correct 312 ms 17076 KB Output is correct
3 Correct 316 ms 17200 KB Output is correct
4 Correct 351 ms 16324 KB Output is correct
5 Correct 324 ms 17000 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 302 ms 17192 KB Output is correct
2 Correct 417 ms 17228 KB Output is correct
3 Correct 279 ms 16952 KB Output is correct
4 Correct 359 ms 16384 KB Output is correct
5 Correct 325 ms 17084 KB Output is correct