Submission #1075323

# Submission time Handle Problem Language Result Execution time Memory
1075323 2024-08-26T02:25:41 Z vjudge1 Mobile (BOI12_mobile) C++17
4 / 100
1000 ms 57224 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 xL = x[i] - d;
            double xR = x[i] + d;
            if (xR < 0) continue;
            else if (xL < 0) xL = 0;
            else {
                if (xL <= L) {
                    if (xR > L) xR = L;
                }
                else {
                    continue;
                }
            }
            I.emplace_back(xL, xR);
        }
        sort(all(I));
        if (I.empty()) return 0;
        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 < 200; i++) {
        double mid = (lo + hi) / 2;
        if (p(mid)) hi = mid;
        else lo = mid;
    }
    cout << fixed << setprecision(8);
    cout << lo << '\n';

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 748 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 764 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 11 ms 760 KB Output is correct
2 Correct 22 ms 784 KB Output is correct
3 Correct 48 ms 792 KB Output is correct
4 Incorrect 6 ms 756 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 279 ms 5116 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 133 ms 5116 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 637 ms 5564 KB Output is correct
2 Correct 946 ms 5716 KB Output is correct
3 Execution timed out 1081 ms 5464 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 846 ms 6624 KB Output is correct
2 Execution timed out 1061 ms 6276 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 220 ms 6324 KB Output is correct
2 Execution timed out 1044 ms 6300 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1035 ms 24752 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1062 ms 28624 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1020 ms 36164 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1012 ms 40860 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1034 ms 39392 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1046 ms 44996 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1048 ms 42632 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1012 ms 49064 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1036 ms 49072 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1038 ms 57224 KB Time limit exceeded
2 Halted 0 ms 0 KB -