Submission #623087

#TimeUsernameProblemLanguageResultExecution timeMemory
62308754skyxenonMobile (BOI12_mobile)C++17
100 / 100
608 ms15980 KiB
// https://oj.uz/problem/view/BOI12_mobile #include <bits/stdc++.h> using namespace std; #define EPS 0.001 int n, l; vector<double> X, Y; bool ok(double radius) { double range = 0; for (int i = 0; i < n; i++) { double term = (radius * radius) - (Y[i] * Y[i]); if (term >= 0) { double term_sqrt = sqrt(term); double range_l = X[i] - term_sqrt; double range_r = X[i] + term_sqrt; if (range_l <= range) { range = max<double>(range, range_r); } } if (range >= l) { return false; } } return true; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin >> n >> l; X.resize(n); Y.resize(n); for (int i = 0; i < n; i++) { cin >> X[i] >> Y[i]; } double lo = 1.0; double hi = 2e9; while (lo + EPS < hi) { double mid = (lo + hi) / 2; if (!ok(mid)) { hi = mid; } else { lo = mid; } } cout << fixed << setprecision(4) << lo << endl; }
#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...