답안 #817133

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
817133 2023-08-09T09:45:40 Z MisterReaper Mobile (BOI12_mobile) C++17
0 / 100
348 ms 35276 KB
// author: MisterReaper (Ahmet Alp Orakci)
#include <bits/stdc++.h>
using namespace std;
#define int long long

#define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
    #include "debug.h"
    #define OPEN freopen(".in", "r", stdin); freopen(".out", "w", stdout);
    #define TIME cerr << "\n" << fixed << setprecision(2) << 1000.0 * clock() / CLOCKS_PER_SEC << " milliseconds ";
#else
    #define debug(...) void(23)
    #define debugarr(...) void(23)
    #define OPEN void(0000)
    #define TIME void(232323233)
#endif

void solve()
{
    int n, m; cin >> n >> m;
    pair <int, int> arr[n];
    for(auto &i : arr) cin >> i.first >> i.second;

    auto check = [&](double mid) -> bool
    {
        double cur = 0;;
        for(auto &i : arr)
        {
            double delta = sqrt(mid * mid - i.second * i.second);
            double nl = i.first - delta;
            if(nl <= cur) cur = i.first + delta;
        }
        return (m <= cur);
    };

    double l = 1, r = 1.5e9, res = 0;
    while((r - l) >= 1e-3)
    {
        double mid = l + (r - l) / 2;
        if(check(mid))
        {
            r = mid;
            res = mid;
        }
        else l = mid;
    }

    cout << fixed << setprecision(6) << res;
    
    return;
}

int32_t main()
{
    OPEN;

    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    int t = 1; //cin >> t;
    while(t--)
    {
        solve();
    }

    TIME;

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 316 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Incorrect 1 ms 332 KB Output isn't correct
4 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 Incorrect 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 468 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Incorrect 2 ms 468 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 28 ms 2264 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 22 ms 2164 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 19 ms 2376 KB Output is correct
2 Correct 20 ms 2764 KB Output is correct
3 Correct 25 ms 2604 KB Output is correct
4 Incorrect 34 ms 3760 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 3408 KB Output is correct
2 Correct 28 ms 3304 KB Output is correct
3 Correct 23 ms 2900 KB Output is correct
4 Incorrect 33 ms 3828 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 25 ms 3284 KB Output is correct
2 Correct 25 ms 3272 KB Output is correct
3 Correct 27 ms 2896 KB Output is correct
4 Incorrect 41 ms 3908 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 109 ms 12340 KB Output is correct
2 Correct 125 ms 15804 KB Output is correct
3 Correct 123 ms 15364 KB Output is correct
4 Incorrect 175 ms 17700 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 134 ms 16336 KB Output is correct
2 Incorrect 183 ms 14740 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 127 ms 14876 KB Output is correct
2 Correct 156 ms 18900 KB Output is correct
3 Correct 147 ms 18392 KB Output is correct
4 Incorrect 196 ms 21588 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 151 ms 19572 KB Output is correct
2 Incorrect 237 ms 17624 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 148 ms 17272 KB Output is correct
2 Correct 178 ms 22120 KB Output is correct
3 Correct 169 ms 21428 KB Output is correct
4 Incorrect 227 ms 24804 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 176 ms 22804 KB Output is correct
2 Incorrect 286 ms 20460 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 170 ms 19724 KB Output is correct
2 Correct 205 ms 25240 KB Output is correct
3 Correct 191 ms 24588 KB Output is correct
4 Incorrect 260 ms 28448 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 201 ms 26028 KB Output is correct
2 Incorrect 289 ms 23444 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 220 ms 24656 KB Output is correct
2 Correct 254 ms 31504 KB Output is correct
3 Correct 239 ms 30520 KB Output is correct
4 Incorrect 334 ms 35276 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 251 ms 32452 KB Output is correct
2 Incorrect 348 ms 29172 KB Output isn't correct
3 Halted 0 ms 0 KB -