Submission #702609

# Submission time Handle Problem Language Result Execution time Memory
702609 2023-02-24T14:57:17 Z nguyennehehe Mobile (BOI12_mobile) C++14
28 / 100
853 ms 22856 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 (x1 > x2) swap(x1, x2);
            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 = 80; i <= ITER; ++i) {
        double m = l + (r - l) / 2;
        if (good(m)) r = m;
        else l = m;
    }
    cout << fixed << setprecision(20) << r;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 324 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 332 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Incorrect 2 ms 332 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 340 KB Output is correct
2 Correct 3 ms 340 KB Output is correct
3 Correct 3 ms 352 KB Output is correct
4 Correct 4 ms 328 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 340 KB Output is correct
2 Correct 3 ms 340 KB Output is correct
3 Correct 5 ms 332 KB Output is correct
4 Correct 4 ms 328 KB Output is correct
5 Correct 4 ms 400 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 68 ms 1612 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 43 ms 1620 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 39 ms 1644 KB Output is correct
2 Correct 44 ms 2100 KB Output is correct
3 Correct 55 ms 1872 KB Output is correct
4 Incorrect 70 ms 2184 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 55 ms 2236 KB Output is correct
2 Correct 51 ms 2124 KB Output is correct
3 Correct 49 ms 2032 KB Output is correct
4 Correct 67 ms 2248 KB Output is correct
5 Incorrect 60 ms 2184 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 48 ms 2220 KB Output is correct
2 Correct 51 ms 2212 KB Output is correct
3 Correct 51 ms 2132 KB Output is correct
4 Correct 63 ms 2200 KB Output is correct
5 Incorrect 66 ms 2124 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 221 ms 5288 KB Output is correct
2 Correct 241 ms 5324 KB Output is correct
3 Correct 240 ms 5340 KB Output is correct
4 Incorrect 315 ms 5264 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 246 ms 5324 KB Output is correct
2 Incorrect 498 ms 5244 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 254 ms 6140 KB Output is correct
2 Correct 286 ms 6064 KB Output is correct
3 Correct 297 ms 6052 KB Output is correct
4 Correct 367 ms 6152 KB Output is correct
5 Correct 356 ms 6140 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 295 ms 6048 KB Output is correct
2 Correct 568 ms 6100 KB Output is correct
3 Correct 320 ms 6096 KB Output is correct
4 Incorrect 393 ms 6164 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 302 ms 6940 KB Output is correct
2 Correct 354 ms 6896 KB Output is correct
3 Correct 345 ms 6848 KB Output is correct
4 Incorrect 485 ms 6836 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 341 ms 6604 KB Output is correct
2 Correct 632 ms 6612 KB Output is correct
3 Correct 347 ms 6604 KB Output is correct
4 Correct 440 ms 6604 KB Output is correct
5 Correct 412 ms 6500 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 363 ms 7264 KB Output is correct
2 Correct 421 ms 7284 KB Output is correct
3 Correct 394 ms 7240 KB Output is correct
4 Correct 532 ms 7124 KB Output is correct
5 Incorrect 484 ms 7124 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 391 ms 7160 KB Output is correct
2 Incorrect 716 ms 7124 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 445 ms 8648 KB Output is correct
2 Correct 513 ms 8660 KB Output is correct
3 Correct 510 ms 8660 KB Output is correct
4 Correct 634 ms 9168 KB Output is correct
5 Correct 571 ms 8508 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 490 ms 8148 KB Output is correct
2 Correct 853 ms 8528 KB Output is correct
3 Correct 528 ms 20416 KB Output is correct
4 Correct 660 ms 22272 KB Output is correct
5 Incorrect 589 ms 22856 KB Output isn't correct
6 Halted 0 ms 0 KB -