Submission #974379

#TimeUsernameProblemLanguageResultExecution timeMemory
974379vjudge1Mobile (BOI12_mobile)C++17
12 / 100
287 ms8536 KiB
#include <bits/stdc++.h> using i64 = long long; int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int N, L; std::cin >> N >> L; std::vector<std::pair<int, int>> p(N); for (auto &[x, y] : p) { std::cin >> x >> y; } auto check = [&](double r) { double cur = 0; for (auto [x, y] : p) { double d = std::sqrt(r * r - y * y); if (x - d <= cur) { cur = std::max(cur, x + d); } } return cur >= L; }; double ans = [&]() { double l = 0, r = 3E9; while (r - l > 1E-5) { double x = l + (r - l) / 2; if (check(x)) { r = x; } else { l = x; } } return l; }(); std::cout << std::fixed << std::setprecision(4) << ans << "\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...