Submission #349545

#TimeUsernameProblemLanguageResultExecution timeMemory
349545FarriusMobile (BOI12_mobile)C++11
50 / 100
275 ms3564 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; const int MX = 1e5 + 5; int n; ld l; pair<ld, ld> ar[MX]; bool check (ld mid) { ld fins = 0; for (int i = 0; i < n; i++) { ld x, y; tie(x, y) = ar[i]; ld delta = sqrt(mid * mid - y * y); if (x - delta <= fins) fins = max(fins, x + delta); } if (fins >= l) return true; else return false; } int main () { cin >> n >> l; for (int i = 0; i < n; i++) { cin >> ar[i].first >> ar[i].second; } ld sol = 1.5e9; ld hi = sol, lo = 0; while (hi - lo > 1e-3) { ld mid = (lo + hi)/2; if (check(mid)) { hi = mid; } else { lo = mid; } } cout << fixed << setprecision(4) << 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...