Submission #491765

#TimeUsernameProblemLanguageResultExecution timeMemory
491765dooompyMobile (BOI12_mobile)C++17
100 / 100
429 ms35416 KiB
#include "bits/stdc++.h" using namespace std; using ll = long long; ll x[1000005], y[1000005]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // freopen("", "r", stdin); // freopen("", "w", stdout); int n, l; cin >> n >> l; for (int i = 0; i < n; i++) { cin >> x[i] >> y[i]; } double lo = 1, hi = 1.5e9; while (hi-lo > 1e-4) { double mid = (hi + lo) / 2; double t = 0; for (int i = 0; i < n; i++) { double length = sqrt(mid * mid - y[i] * y[i]); double left = x[i] - length; double right = x[i] + length; if (left <= t) { t = max(t, right); } } if (t >= l) { hi = mid; } else { lo = mid; } } cout << fixed << setprecision(10) << lo << "\n"; }
#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...