답안 #550801

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
550801 2022-04-19T08:37:53 Z CyberSleeper Mobile (BOI12_mobile) C++14
100 / 100
411 ms 24120 KB
#include <bits/stdc++.h>
#define fastio      ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define debug(x)    cout << "Line " << __LINE__ << ", " << #x << " is " << x << endl
#define all(x)      x.begin(), x.end()
#define fi          first
#define se          second
#define mp          make_pair
#define pb          push_back
#define ll          long long
#define ull         unsigned long long
#define pll         pair<ll, ll>
#define pii         pair<int, int>
#define pld         pair<ld, ld>
#define ld          double
#define nl          endl
#define tb          '\t'
#define sp          ' '
#define sqr(x)      (x)*(x)
#define arr3        array<int, 3>
using namespace std;
 
const int MX=1000005, MOD=1000000007, BLOCK=160, INF=2e9+7, LG=62;
const ll INFF=1000000000000000007;
const ld ERR=1e-3, pi=3.14159265358979323846;

int N;
int L;
pll A[MX];

int main(){
    fastio;
    cin >> N >> L;
    for(int i=1; i<=N; i++){
        cin >> A[i].fi >> A[i].se;
    }
    ld le=0, ri=1e10, mi, ans;
    while(le+ERR<=ri){
        mi=(le+ri)/2;
        ld best=0;
        for(int i=1; i<=N; i++){
            ld dist=sqrt(mi*mi - A[i].se*A[i].se);
            ld lef=A[i].fi-dist, rig=A[i].fi+dist;
            if(lef<=best)
                best=max(best, rig);
        }
        if(L<=best){
            ri=mi;
            ans=mi;
        }else
            le=mi;
    }
    cout << fixed << setprecision(4) << ans << nl;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 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 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 2 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 1492 KB Output is correct
2 Correct 23 ms 1516 KB Output is correct
3 Correct 17 ms 1108 KB Output is correct
4 Correct 31 ms 1488 KB Output is correct
5 Correct 14 ms 1108 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 23 ms 1552 KB Output is correct
2 Correct 25 ms 1388 KB Output is correct
3 Correct 26 ms 1596 KB Output is correct
4 Correct 30 ms 1480 KB Output is correct
5 Correct 33 ms 1652 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 1620 KB Output is correct
2 Correct 27 ms 1488 KB Output is correct
3 Correct 23 ms 1620 KB Output is correct
4 Correct 39 ms 1864 KB Output is correct
5 Correct 28 ms 1700 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 1876 KB Output is correct
2 Correct 42 ms 1872 KB Output is correct
3 Correct 32 ms 1876 KB Output is correct
4 Correct 53 ms 1888 KB Output is correct
5 Correct 39 ms 1868 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 30 ms 1996 KB Output is correct
2 Correct 28 ms 1844 KB Output is correct
3 Correct 33 ms 1784 KB Output is correct
4 Correct 42 ms 1876 KB Output is correct
5 Correct 35 ms 1876 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 146 ms 8012 KB Output is correct
2 Correct 165 ms 15924 KB Output is correct
3 Correct 151 ms 15304 KB Output is correct
4 Correct 215 ms 17608 KB Output is correct
5 Correct 179 ms 15052 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 150 ms 8012 KB Output is correct
2 Correct 235 ms 8112 KB Output is correct
3 Correct 177 ms 8136 KB Output is correct
4 Correct 187 ms 8136 KB Output is correct
5 Correct 166 ms 8136 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 150 ms 9600 KB Output is correct
2 Correct 182 ms 9704 KB Output is correct
3 Correct 180 ms 9604 KB Output is correct
4 Correct 231 ms 9672 KB Output is correct
5 Correct 202 ms 9772 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 192 ms 9700 KB Output is correct
2 Correct 260 ms 9716 KB Output is correct
3 Correct 178 ms 9712 KB Output is correct
4 Correct 231 ms 9608 KB Output is correct
5 Correct 211 ms 9704 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 181 ms 11268 KB Output is correct
2 Correct 263 ms 11236 KB Output is correct
3 Correct 202 ms 11272 KB Output is correct
4 Correct 279 ms 11340 KB Output is correct
5 Correct 237 ms 11268 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 224 ms 11340 KB Output is correct
2 Correct 298 ms 11216 KB Output is correct
3 Correct 192 ms 11260 KB Output is correct
4 Correct 268 ms 11264 KB Output is correct
5 Correct 263 ms 11172 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 195 ms 12748 KB Output is correct
2 Correct 266 ms 24020 KB Output is correct
3 Correct 240 ms 24120 KB Output is correct
4 Correct 341 ms 22552 KB Output is correct
5 Correct 280 ms 23884 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 247 ms 12748 KB Output is correct
2 Correct 358 ms 12812 KB Output is correct
3 Correct 229 ms 12912 KB Output is correct
4 Correct 305 ms 12752 KB Output is correct
5 Correct 274 ms 12748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 265 ms 15960 KB Output is correct
2 Correct 296 ms 15960 KB Output is correct
3 Correct 290 ms 16084 KB Output is correct
4 Correct 384 ms 15956 KB Output is correct
5 Correct 350 ms 16012 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 321 ms 15908 KB Output is correct
2 Correct 411 ms 16012 KB Output is correct
3 Correct 304 ms 15940 KB Output is correct
4 Correct 391 ms 16076 KB Output is correct
5 Correct 354 ms 15948 KB Output is correct