Submission #217136

# Submission time Handle Problem Language Result Execution time Memory
217136 2020-03-29T06:06:24 Z dolphingarlic Mobile (BOI12_mobile) C++14
100 / 100
711 ms 30856 KB
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("O3")
#pragma GCC target("sse4,avx2,fma,avx")
#define FOR(i, x, y) for (int i = x; i < y; i++)
#define x first
#define y second
using namespace std;

pair<long long, long long> p[1000000];

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n, len;
    cin >> n >> len;
    FOR(i, 0, n) cin >> p[i].x >> p[i].y;

    double l = 1, r = 5e8;
    while (r - l > 1e-3) {
        double mid = (l + r) / 2, curr = 0;
        FOR(i, 0, n) {
            double delta = sqrt(mid * mid - p[i].y * p[i].y);
            double a = p[i].x - delta, b = p[i].x + delta;
            if (a <= curr) curr = max(curr, b);
        }

        if (curr >= len) r = mid;
        else l = mid;
    }

    cout << fixed << setprecision(4) << l;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 6 ms 512 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 6 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 512 KB Output is correct
2 Correct 7 ms 512 KB Output is correct
3 Correct 6 ms 512 KB Output is correct
4 Correct 8 ms 512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 9 ms 512 KB Output is correct
2 Correct 7 ms 512 KB Output is correct
3 Correct 7 ms 512 KB Output is correct
4 Correct 8 ms 512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 512 KB Output is correct
2 Correct 7 ms 512 KB Output is correct
3 Correct 6 ms 512 KB Output is correct
4 Correct 8 ms 512 KB Output is correct
5 Correct 7 ms 512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 49 ms 1920 KB Output is correct
2 Correct 51 ms 2168 KB Output is correct
3 Correct 31 ms 1536 KB Output is correct
4 Correct 53 ms 2048 KB Output is correct
5 Correct 29 ms 1536 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 46 ms 1920 KB Output is correct
2 Correct 45 ms 1920 KB Output is correct
3 Correct 56 ms 2256 KB Output is correct
4 Correct 58 ms 2212 KB Output is correct
5 Correct 65 ms 2296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 49 ms 2048 KB Output is correct
2 Correct 48 ms 2176 KB Output is correct
3 Correct 42 ms 2176 KB Output is correct
4 Correct 81 ms 2600 KB Output is correct
5 Correct 57 ms 2304 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 61 ms 2432 KB Output is correct
2 Correct 56 ms 2432 KB Output is correct
3 Correct 45 ms 2432 KB Output is correct
4 Correct 78 ms 2552 KB Output is correct
5 Correct 72 ms 2560 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 61 ms 2552 KB Output is correct
2 Correct 57 ms 2556 KB Output is correct
3 Correct 49 ms 2560 KB Output is correct
4 Correct 75 ms 2552 KB Output is correct
5 Correct 68 ms 2560 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 249 ms 8952 KB Output is correct
2 Correct 270 ms 9080 KB Output is correct
3 Correct 287 ms 9080 KB Output is correct
4 Correct 369 ms 9080 KB Output is correct
5 Correct 316 ms 9276 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 292 ms 8952 KB Output is correct
2 Correct 343 ms 9208 KB Output is correct
3 Correct 238 ms 9080 KB Output is correct
4 Correct 376 ms 9120 KB Output is correct
5 Correct 328 ms 9080 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 311 ms 10616 KB Output is correct
2 Correct 354 ms 10904 KB Output is correct
3 Correct 348 ms 11424 KB Output is correct
4 Correct 447 ms 11284 KB Output is correct
5 Correct 400 ms 11416 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 367 ms 11336 KB Output is correct
2 Correct 417 ms 11420 KB Output is correct
3 Correct 298 ms 11448 KB Output is correct
4 Correct 455 ms 11360 KB Output is correct
5 Correct 409 ms 11412 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 366 ms 12792 KB Output is correct
2 Correct 392 ms 12968 KB Output is correct
3 Correct 386 ms 12980 KB Output is correct
4 Correct 519 ms 12964 KB Output is correct
5 Correct 451 ms 12920 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 418 ms 12820 KB Output is correct
2 Correct 466 ms 12984 KB Output is correct
3 Correct 317 ms 12920 KB Output is correct
4 Correct 485 ms 12920 KB Output is correct
5 Correct 465 ms 12920 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 407 ms 14592 KB Output is correct
2 Correct 452 ms 14456 KB Output is correct
3 Correct 429 ms 14536 KB Output is correct
4 Correct 607 ms 14492 KB Output is correct
5 Correct 520 ms 14456 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 444 ms 14560 KB Output is correct
2 Correct 524 ms 14516 KB Output is correct
3 Correct 380 ms 14712 KB Output is correct
4 Correct 558 ms 14456 KB Output is correct
5 Correct 530 ms 14436 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 495 ms 17588 KB Output is correct
2 Correct 558 ms 17376 KB Output is correct
3 Correct 447 ms 17260 KB Output is correct
4 Correct 711 ms 16112 KB Output is correct
5 Correct 639 ms 29664 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 552 ms 17124 KB Output is correct
2 Correct 675 ms 17212 KB Output is correct
3 Correct 471 ms 17040 KB Output is correct
4 Correct 703 ms 15996 KB Output is correct
5 Correct 678 ms 30856 KB Output is correct