답안 #1031423

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1031423 2024-07-22T20:23:14 Z vjudge1 Mobile (BOI12_mobile) C++17
100 / 100
471 ms 35408 KB
#include <bits/stdc++.h>

using namespace std;

using ll = long long;

#define int ll
#define vi vector<int>
#define ii pair<int,int>
#define x first
#define y second
#define fore(a, b, c) for(int a=b; a<c; ++a)
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define endl '\n'
#define dbg(x) cerr << #x << ": " << x << endl
#define raya cerr << "================" << endl;

double eps = 1e-4;

signed main(){

    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int n, len;
    cin >> n >> len;

    vector<ii> p(n);
    fore(i, 0, n){
        cin >> p[i].x >> p[i].y;
    }

    double low = 0, high = 1e9+5;
    double ans = high;

    while((high - low) > eps){
        double mid = low + (high - low) / 2;
        
        double mx = 0;

        fore(i, 0, n){
            double delta = (2*p[i].x)*(2*p[i].x)-4*(p[i].x*p[i].x+p[i].y*p[i].y-mid*mid);
            double a = (2*p[i].x - sqrt(delta)) / 2;
            double b = (2*p[i].x + sqrt(delta)) / 2;
            
            if(a <= mx){
                mx = max(mx, b);
            }
        }

        if(mx >= len){
            ans = mid;
            high = mid-eps;
        } else {
            low = mid+eps;
        }

    }

    cout << fixed << setprecision(6) << ans;

}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 4 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 3 ms 348 KB Output is correct
5 Correct 2 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 33 ms 1624 KB Output is correct
2 Correct 21 ms 1628 KB Output is correct
3 Correct 15 ms 1116 KB Output is correct
4 Correct 34 ms 1628 KB Output is correct
5 Correct 21 ms 1116 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 1628 KB Output is correct
2 Correct 28 ms 1372 KB Output is correct
3 Correct 33 ms 1628 KB Output is correct
4 Correct 34 ms 1628 KB Output is correct
5 Correct 39 ms 1628 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 1624 KB Output is correct
2 Correct 22 ms 1624 KB Output is correct
3 Correct 24 ms 1628 KB Output is correct
4 Correct 48 ms 1884 KB Output is correct
5 Correct 33 ms 1628 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 1884 KB Output is correct
2 Correct 25 ms 1880 KB Output is correct
3 Correct 27 ms 1884 KB Output is correct
4 Correct 48 ms 1884 KB Output is correct
5 Correct 42 ms 1884 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 1880 KB Output is correct
2 Correct 26 ms 1884 KB Output is correct
3 Correct 27 ms 1884 KB Output is correct
4 Correct 50 ms 1884 KB Output is correct
5 Correct 40 ms 1884 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 132 ms 8284 KB Output is correct
2 Correct 135 ms 8284 KB Output is correct
3 Correct 124 ms 8280 KB Output is correct
4 Correct 232 ms 8280 KB Output is correct
5 Correct 211 ms 8284 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 128 ms 8280 KB Output is correct
2 Correct 238 ms 8284 KB Output is correct
3 Correct 136 ms 8284 KB Output is correct
4 Correct 259 ms 8280 KB Output is correct
5 Correct 208 ms 8280 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 147 ms 9824 KB Output is correct
2 Correct 153 ms 9816 KB Output is correct
3 Correct 149 ms 9816 KB Output is correct
4 Correct 301 ms 9816 KB Output is correct
5 Correct 223 ms 9820 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 153 ms 10072 KB Output is correct
2 Correct 296 ms 9820 KB Output is correct
3 Correct 163 ms 9816 KB Output is correct
4 Correct 280 ms 9820 KB Output is correct
5 Correct 252 ms 9816 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 168 ms 11352 KB Output is correct
2 Correct 171 ms 11356 KB Output is correct
3 Correct 176 ms 11356 KB Output is correct
4 Correct 333 ms 11356 KB Output is correct
5 Correct 289 ms 20620 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 186 ms 11356 KB Output is correct
2 Correct 324 ms 11356 KB Output is correct
3 Correct 197 ms 11352 KB Output is correct
4 Correct 298 ms 11356 KB Output is correct
5 Correct 308 ms 21508 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 184 ms 12888 KB Output is correct
2 Correct 207 ms 12888 KB Output is correct
3 Correct 191 ms 12892 KB Output is correct
4 Correct 366 ms 12892 KB Output is correct
5 Correct 339 ms 24020 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 235 ms 12892 KB Output is correct
2 Correct 366 ms 12888 KB Output is correct
3 Correct 220 ms 12892 KB Output is correct
4 Correct 348 ms 12892 KB Output is correct
5 Correct 334 ms 24368 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 216 ms 15960 KB Output is correct
2 Correct 248 ms 15964 KB Output is correct
3 Correct 242 ms 15964 KB Output is correct
4 Correct 471 ms 15964 KB Output is correct
5 Correct 398 ms 29520 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 258 ms 15964 KB Output is correct
2 Correct 426 ms 15964 KB Output is correct
3 Correct 300 ms 28388 KB Output is correct
4 Correct 458 ms 35408 KB Output is correct
5 Correct 432 ms 30688 KB Output is correct