Submission #464196

#TimeUsernameProblemLanguageResultExecution timeMemory
464196dqkMobile (BOI12_mobile)C++17
65 / 100
834 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]; } sort(p.begin(), p.end()); double lo = 0.0, hi = 3e9; while(hi - lo > 1e-6) { double mi = lo + (hi - lo) / 2; double cur = 0.0; for (int i = 0; i < n; ++i) { double d = sqrt(mi * mi - 1ll * p[i][1] * p[i][1]); if (cur >= p[i][0] - d) cur = std::max(cur, p[i][0] + d); } if (cur >= L) { hi = mi; } else { lo = mi; } } std::cout << std::setprecision(10) << 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...