Submission #1075304

# Submission time Handle Problem Language Result Execution time Memory
1075304 2024-08-26T01:40:28 Z vjudge1 Mobile (BOI12_mobile) C++17
0 / 100
1000 ms 40412 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 = x[i] - d;
            double x2 = x[i] + d;
            x1 = max(x1, 0.0);
            x2 = min(x2, (double)L);
            I.emplace_back(x1,x2);
        }
        sort(all(I));
        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 = 4e9;
    for (int i = 0; i < 200; i++) {
        double mid = (lo + hi) / 2.0;
        if (p(mid)) lo = mid;
        else hi = mid;
    }
    cout << fixed << setprecision(6);
    cout << lo << '\n';

    return 0;
}
# 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 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 780 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 712 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 700 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 119 ms 4348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 95 ms 4400 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 535 ms 4672 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 145 ms 4856 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 138 ms 4892 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1069 ms 20464 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 785 ms 20460 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1048 ms 31064 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 952 ms 31004 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1008 ms 33364 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1080 ms 33344 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1041 ms 35812 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1059 ms 35688 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1074 ms 40396 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1046 ms 40412 KB Time limit exceeded
2 Halted 0 ms 0 KB -