Submission #464175

#TimeUsernameProblemLanguageResultExecution timeMemory
464175dqkMobile (BOI12_mobile)C++17
8 / 100
623 ms55108 KiB
#include <bits/stdc++.h> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); int n; double L; std::cin >> n >> L; std::vector<std::vector<int>> p(n, std::vector<int>(2, 0)); for (int i = 0; i < n; ++i) { std::cin >> p[i][0] >> p[i][1]; p[i][1] = abs(p[i][1]); } sort(p.begin(), p.end()); double lo = 0.0, hi = 4e9; while(hi - lo > 1e-5) { double mi = (lo + hi) / 2; double cur = 0.0; for (int i = 0; i < n; ++i) { double h = 1.0 * 1ll * p[i][1]; if (h > mi) continue; double d = sqrt(mi * mi - h * h); if (cur >= 1.0 * p[i][0] - d) cur = std::max(cur, 1.0 * p[i][0] + d); } bool ok = cur >= L; if (ok) { hi = mi; } else { lo = mi; } } std::cout << lo << "\n"; return 0; }
#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...