Submission #1127295

#TimeUsernameProblemLanguageResultExecution timeMemory
1127295classicMobile (BOI12_mobile)C++20
100 / 100
385 ms16088 KiB
// mode: short code /* practicing.. */ #include <bits/stdc++.h> int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); int n, l; std::cin >> n >> l; std::vector<std::pair<long long, long long>> p(n); for (int i = 0; i < n; i++) { std::cin >> p[i].first >> p[i].second; } double low = 1, high = 1.5e9; constexpr double EXP = 1e-3; while (high - low > EXP) { double mid = (low + high) / 2; double cur = 0; for (int i = 0; i < n; i++) { double del = sqrt(mid * mid - p[i].second * p[i].second); double a = p[i].first - del; double b = p[i].first + del; if (a <= cur) { cur = std::max(cur, b); } } if (cur >= l) { high = mid; } else { low = mid; } } std::cout << std::fixed << std::setprecision(4) << low; 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...