Submission #702626

#TimeUsernameProblemLanguageResultExecution timeMemory
702626nguyenneheheMobile (BOI12_mobile)C++14
100 / 100
755 ms21932 KiB
#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 = max(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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...