Submission #1075309

# Submission time Handle Problem Language Result Execution time Memory
1075309 2024-08-26T02:05:54 Z vjudge1 Mobile (BOI12_mobile) C++17
0 / 100
1000 ms 58612 KB
#include <bits/stdc++.h>
using namespace std;

#define dbg(x) cerr << #x << " = " << x << endl
#define raya cerr << string(20, '=') << endl
#define pv(x) cerr << #x << "[] : "; for (auto e:x) cerr << e << " "; cerr << endl

#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define eb emplace_back
#define ff first
#define ss second

typedef long long ll;

int main() {
    ios_base::sync_with_stdio(NULL);
    cin.tie(nullptr);
    int n,L;
    cin >> n >> L;
    vector<int> x(n), y(n);
    for (int i = 0; i < n; i++) cin >> x[i] >> y[i];

    auto p = [&](double R) -> bool {
        vector<pair<double,double>> I;
        for (int i = 0; i < n; i++) {
            if (abs(y[i]) > R) continue;
            double d = sqrt(R * R - 1ll * y[i] * y[i]);
            double x1 = max(x[i] - d, 0.0);
            double x2 = min(x[i] + d, (double) L);
            I.emplace_back(x1,x2);
        }
        sort(all(I));
        if (I.front().ff > 0 or I.back().ss < L) return 0;
        for (int i = 0; i < sz(I) - 1; i++) {
            if (I[i].ss > I[i + 1].ff) return 0;
        }       
        return 1;
    };
    double lo = 0, hi = 2e9;
    for (int i = 0; i < 50; i++) {
        double mid = lo + (hi - lo) / 2;
        if (p(mid)) lo = mid;
        else hi = mid;
    }
    cout << fixed << setprecision(8);
    cout << lo << '\n';

    return 0;
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 748 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 744 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 808 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 71 ms 5112 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 79 ms 5156 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 94 ms 5316 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 137 ms 7680 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 75 ms 6408 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 656 ms 24748 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 678 ms 32628 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 838 ms 36212 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 844 ms 52000 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 922 ms 39392 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 938 ms 55280 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1070 ms 42636 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1045 ms 58612 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1047 ms 49228 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1044 ms 56900 KB Time limit exceeded
2 Halted 0 ms 0 KB -