답안 #990610

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
990610 2024-05-30T17:15:44 Z Ska Mobile (BOI12_mobile) C++14
100 / 100
388 ms 35176 KB
#include <bits/stdc++.h>
using namespace std;

const int N = 1e6 + 5;

int n;
double m;
double x[N], y[N];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n >> m;
    double l = 2e9, r = 1.5e9;
    for (int i = 1; i <= n; ++i) {
        cin >> x[i] >> y[i];
        l = min(l, abs(y[i]));
    }
    while (r - l >= 1e-3) {
        double mid = (l + r) / 2;
        double cur = 0;
        for (int i = 1; i <= n; ++i) {
            if (mid < abs(y[i])) {
                continue;
            }
            double d = sqrt(mid * mid - y[i] * y[i]);
            double a = x[i] - d, b = x[i] + d;
            if (a <= cur) {
                cur = max(cur, b);
            }
            if (cur >= m) {
                break;
            }
        }
        if (cur >= m) {
            r = mid;
        } else {
            l = mid;
        }
    }
    cout << fixed << setprecision(6) << l << '\n';
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 0 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 0 ms 2396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 0 ms 2396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2392 KB Output is correct
2 Correct 2 ms 2396 KB Output is correct
3 Correct 2 ms 2396 KB Output is correct
4 Correct 2 ms 2396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2396 KB Output is correct
2 Correct 2 ms 2396 KB Output is correct
3 Correct 2 ms 2396 KB Output is correct
4 Correct 2 ms 2396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2392 KB Output is correct
2 Correct 2 ms 2424 KB Output is correct
3 Correct 2 ms 2392 KB Output is correct
4 Correct 2 ms 2396 KB Output is correct
5 Correct 2 ms 2396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 6744 KB Output is correct
2 Correct 24 ms 6740 KB Output is correct
3 Correct 16 ms 4752 KB Output is correct
4 Correct 24 ms 6532 KB Output is correct
5 Correct 13 ms 4744 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 6748 KB Output is correct
2 Correct 20 ms 4700 KB Output is correct
3 Correct 26 ms 6796 KB Output is correct
4 Correct 26 ms 6800 KB Output is correct
5 Correct 29 ms 6748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 6748 KB Output is correct
2 Correct 26 ms 6748 KB Output is correct
3 Correct 23 ms 6748 KB Output is correct
4 Correct 35 ms 6532 KB Output is correct
5 Correct 24 ms 6744 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 34 ms 6716 KB Output is correct
2 Correct 33 ms 6748 KB Output is correct
3 Correct 28 ms 6796 KB Output is correct
4 Correct 36 ms 6748 KB Output is correct
5 Correct 29 ms 6528 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 37 ms 6736 KB Output is correct
2 Correct 32 ms 6748 KB Output is correct
3 Correct 28 ms 6736 KB Output is correct
4 Correct 36 ms 6776 KB Output is correct
5 Correct 29 ms 6748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 166 ms 10836 KB Output is correct
2 Correct 179 ms 10832 KB Output is correct
3 Correct 170 ms 18008 KB Output is correct
4 Correct 172 ms 20304 KB Output is correct
5 Correct 153 ms 17492 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 189 ms 10876 KB Output is correct
2 Correct 202 ms 17232 KB Output is correct
3 Correct 144 ms 16372 KB Output is correct
4 Correct 167 ms 20052 KB Output is correct
5 Correct 160 ms 18164 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 202 ms 14992 KB Output is correct
2 Correct 188 ms 14928 KB Output is correct
3 Correct 200 ms 23636 KB Output is correct
4 Correct 215 ms 26608 KB Output is correct
5 Correct 178 ms 22868 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 207 ms 14972 KB Output is correct
2 Correct 235 ms 22892 KB Output is correct
3 Correct 168 ms 21588 KB Output is correct
4 Correct 234 ms 26708 KB Output is correct
5 Correct 183 ms 23656 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 223 ms 14932 KB Output is correct
2 Correct 235 ms 14932 KB Output is correct
3 Correct 215 ms 24916 KB Output is correct
4 Correct 241 ms 28276 KB Output is correct
5 Correct 212 ms 23892 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 227 ms 14932 KB Output is correct
2 Correct 270 ms 24420 KB Output is correct
3 Correct 203 ms 23120 KB Output is correct
4 Correct 243 ms 28240 KB Output is correct
5 Correct 210 ms 24916 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 253 ms 14928 KB Output is correct
2 Correct 265 ms 27220 KB Output is correct
3 Correct 261 ms 26452 KB Output is correct
4 Correct 285 ms 30548 KB Output is correct
5 Correct 240 ms 25940 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 267 ms 14928 KB Output is correct
2 Correct 330 ms 25424 KB Output is correct
3 Correct 228 ms 24404 KB Output is correct
4 Correct 281 ms 30288 KB Output is correct
5 Correct 244 ms 26452 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 319 ms 15952 KB Output is correct
2 Correct 301 ms 31572 KB Output is correct
3 Correct 329 ms 30448 KB Output is correct
4 Correct 340 ms 35156 KB Output is correct
5 Correct 299 ms 29548 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 362 ms 15988 KB Output is correct
2 Correct 388 ms 29052 KB Output is correct
3 Correct 283 ms 28132 KB Output is correct
4 Correct 337 ms 35176 KB Output is correct
5 Correct 300 ms 30800 KB Output is correct