Submission #702607

# Submission time Handle Problem Language Result Execution time Memory
702607 2023-02-24T14:50:38 Z nguyennehehe Mobile (BOI12_mobile) C++14
28 / 100
1000 ms 24512 KB
#include "bits/stdc++.h"
using namespace std;

const int INF = 1e9 + 7;

int32_t main() {
    cin.tie(0)->sync_with_stdio(0);
    
    int n, L; cin >> n >> L;
    vector<pair<int, int>> a(n);
    for (auto &x: a) cin >> x.first >> x.second;

    auto good = [&](double R) {
        double l = INF, r = -INF;
        for (auto i: a) {
            long long u, v; tie(u, v) = i;
            #define sqr(x) (x) * (x)
            double delta = sqrt(sqr(R) - sqr(v));
            double x1 = -delta + u, x2 = delta + u;
            if (l != INF && (x1 > r || x2 < l)) continue;
            l = min(l, x1), r = max(r, x2);
            // cout << fixed << setprecision(10) << x1 << ' ' << x2 << '\n';
        }
        return l <= 0 && r >= L;
    };

    double l = -1, r = 1e9 + 1;
    for (int i = 1, ITER = 100; i <= ITER; ++i) {
        double m = l + (r - l) / 2;
        if (good(m)) r = m;
        else l = m;
    }
    cout << fixed << setprecision(9) << r;
    good(1);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 320 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 356 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Incorrect 2 ms 352 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 396 KB Output is correct
2 Correct 4 ms 428 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 4 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 340 KB Output is correct
2 Correct 5 ms 428 KB Output is correct
3 Correct 4 ms 396 KB Output is correct
4 Correct 7 ms 328 KB Output is correct
5 Correct 5 ms 400 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 85 ms 1620 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 57 ms 1620 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 56 ms 1640 KB Output is correct
2 Correct 45 ms 2100 KB Output is correct
3 Correct 47 ms 1876 KB Output is correct
4 Incorrect 76 ms 3012 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 59 ms 2616 KB Output is correct
2 Correct 58 ms 2500 KB Output is correct
3 Correct 60 ms 2124 KB Output is correct
4 Correct 75 ms 3020 KB Output is correct
5 Incorrect 68 ms 2248 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 53 ms 2508 KB Output is correct
2 Correct 62 ms 2508 KB Output is correct
3 Correct 58 ms 2132 KB Output is correct
4 Correct 91 ms 3020 KB Output is correct
5 Incorrect 76 ms 2252 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 259 ms 8436 KB Output is correct
2 Correct 280 ms 11892 KB Output is correct
3 Correct 282 ms 11380 KB Output is correct
4 Incorrect 392 ms 13684 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 300 ms 12400 KB Output is correct
2 Incorrect 605 ms 10740 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 349 ms 10108 KB Output is correct
2 Correct 333 ms 14208 KB Output is correct
3 Correct 324 ms 13568 KB Output is correct
4 Correct 448 ms 16772 KB Output is correct
5 Correct 425 ms 12864 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 352 ms 14848 KB Output is correct
2 Correct 722 ms 12876 KB Output is correct
3 Correct 334 ms 11772 KB Output is correct
4 Incorrect 455 ms 16644 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 429 ms 11724 KB Output is correct
2 Correct 387 ms 16536 KB Output is correct
3 Correct 386 ms 15888 KB Output is correct
4 Incorrect 749 ms 19216 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 387 ms 17292 KB Output is correct
2 Correct 776 ms 15052 KB Output is correct
3 Correct 380 ms 14100 KB Output is correct
4 Correct 529 ms 19092 KB Output is correct
5 Correct 514 ms 15824 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 435 ms 13516 KB Output is correct
2 Correct 463 ms 18848 KB Output is correct
3 Correct 459 ms 18080 KB Output is correct
4 Correct 601 ms 22176 KB Output is correct
5 Incorrect 565 ms 17712 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 460 ms 19752 KB Output is correct
2 Incorrect 919 ms 17068 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 484 ms 16704 KB Output is correct
2 Correct 546 ms 23612 KB Output is correct
3 Correct 537 ms 22608 KB Output is correct
4 Correct 744 ms 18892 KB Output is correct
5 Correct 714 ms 21692 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 575 ms 24512 KB Output is correct
2 Execution timed out 1042 ms 21304 KB Time limit exceeded
3 Halted 0 ms 0 KB -