Submission #702627

# Submission time Handle Problem Language Result Execution time Memory
702627 2023-02-24T15:33:49 Z nguyennehehe Mobile (BOI12_mobile) C++14
0 / 100
792 ms 8148 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 = 0;
        for (auto i: a) {
            long long u, v; tie(u, v) = i;
            #define sqr(x) (x) * (x)
            if (sqr(R) - sqr(v) < 0) continue;
            double delta = sqrt(sqr(R) - sqr(v));
            double x1 = -delta + u, x2 = delta + u;
            if (x1 <= l) l = x2;
            // cout << fixed << setprecision(10) << x1 << ' ' << x2 << '\n';
        }
        return l >= 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;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Incorrect 1 ms 340 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 356 KB Output is correct
3 Correct 3 ms 340 KB Output is correct
4 Incorrect 3 ms 468 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 63 ms 852 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 852 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 34 ms 980 KB Output is correct
2 Correct 39 ms 852 KB Output is correct
3 Correct 31 ms 980 KB Output is correct
4 Incorrect 37 ms 1108 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 45 ms 1108 KB Output is correct
2 Correct 43 ms 1108 KB Output is correct
3 Correct 38 ms 1108 KB Output is correct
4 Incorrect 40 ms 1108 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 48 ms 1108 KB Output is correct
2 Correct 43 ms 1108 KB Output is correct
3 Correct 39 ms 1108 KB Output is correct
4 Incorrect 33 ms 1108 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 196 ms 4180 KB Output is correct
2 Correct 224 ms 4180 KB Output is correct
3 Correct 211 ms 4180 KB Output is correct
4 Incorrect 158 ms 4180 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 229 ms 4180 KB Output is correct
2 Incorrect 447 ms 4180 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 234 ms 4948 KB Output is correct
2 Correct 259 ms 4948 KB Output is correct
3 Correct 257 ms 4948 KB Output is correct
4 Incorrect 189 ms 4948 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 259 ms 4948 KB Output is correct
2 Incorrect 560 ms 4948 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 278 ms 5716 KB Output is correct
2 Correct 303 ms 5716 KB Output is correct
3 Correct 300 ms 5716 KB Output is correct
4 Incorrect 225 ms 5716 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 300 ms 5716 KB Output is correct
2 Incorrect 640 ms 5716 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 322 ms 6484 KB Output is correct
2 Correct 345 ms 6484 KB Output is correct
3 Correct 339 ms 6484 KB Output is correct
4 Incorrect 257 ms 6484 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 354 ms 6484 KB Output is correct
2 Incorrect 710 ms 6484 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 397 ms 8148 KB Output is correct
2 Correct 430 ms 8148 KB Output is correct
3 Correct 425 ms 8148 KB Output is correct
4 Incorrect 309 ms 8148 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 438 ms 8148 KB Output is correct
2 Incorrect 792 ms 8148 KB Output isn't correct
3 Halted 0 ms 0 KB -