Submission #979720

#TimeUsernameProblemLanguageResultExecution timeMemory
97972012345678Mobile (BOI12_mobile)C++17
100 / 100
552 ms35456 KiB
#include <bits/stdc++.h> using namespace std; const int nx=1e6+5; int n, L; pair<double, double> p[nx]; int main() { cin.tie(NULL)->sync_with_stdio(false); cin>>n>>L; for (int i=1; i<=n; i++) cin>>p[i].first>>p[i].second; double l=0, r=2e9; while (r-l>1e-4) { double md=(l+r)/2, mx=0; for (int i=1; i<=n; i++) { double x=md*md-p[i].second*p[i].second; if (x<0) continue; x=sqrt(x); if (p[i].first-x<=mx) mx=max(mx, p[i].first+x); } if (mx>=L) r=md; else l=md; } cout<<fixed<<setprecision(4)<<l; }
#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...