답안 #973124

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
973124 2024-05-01T14:00:29 Z njoop Mobile (BOI12_mobile) C++17
0 / 100
601 ms 34032 KB
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#define pi pair<double, double>
using namespace std;

double x, y, L, l=0, r=1e9, mid, de, cov;
pi arr[1000010];
vector<pi> in;
int n;

bool solve(double rad) {
    in.clear();
    cov = 0;
    for(int i=1; i<=n; i++) {
        de = sqrt(rad*rad - arr[i].second*arr[i].second);
        if(de < 0) continue;
        in.push_back({arr[i].first-de, arr[i].first+de});
    }
    for(auto i: in) {
        if(i.first > cov) return 0;
        cov = max(cov, i.second);
        if(cov >= L) return 1;
    }
    return 0;
}

int main() {
    cin.tie(0)->sync_with_stdio(0);
    cin >> n >> L;
    for(int i=1; i<=n; i++) {
        cin >> arr[i].first >> arr[i].second;
    }
    while(l+0.0001 < r) {
        mid = (l+r)/2;
        if(solve(mid)) {
            r = mid;
        } else {
            l = mid + 0.0001;
        }
    }
    cout << fixed << setprecision(6) << l;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 604 KB Output is correct
2 Correct 3 ms 604 KB Output is correct
3 Incorrect 3 ms 600 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 43 ms 4816 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 38 ms 4812 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 39 ms 4812 KB Output is correct
2 Incorrect 39 ms 4808 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 48 ms 4824 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 51 ms 4844 KB Output is correct
2 Incorrect 58 ms 4812 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 232 ms 18672 KB Output is correct
2 Correct 237 ms 17144 KB Output is correct
3 Correct 237 ms 17604 KB Output is correct
4 Incorrect 324 ms 18632 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 240 ms 18372 KB Output is correct
2 Incorrect 312 ms 17364 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 281 ms 28648 KB Output is correct
2 Incorrect 285 ms 28904 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 318 ms 28664 KB Output is correct
2 Incorrect 383 ms 28120 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 360 ms 30696 KB Output is correct
2 Incorrect 328 ms 30184 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 338 ms 31168 KB Output is correct
2 Incorrect 454 ms 29952 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 392 ms 31728 KB Output is correct
2 Incorrect 382 ms 33520 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 415 ms 33520 KB Output is correct
2 Incorrect 492 ms 33008 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 472 ms 33788 KB Output is correct
2 Incorrect 482 ms 33256 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 480 ms 33216 KB Output is correct
2 Incorrect 601 ms 34032 KB Output isn't correct
3 Halted 0 ms 0 KB -