Submission #898473

#TimeUsernameProblemLanguageResultExecution timeMemory
898473ivazivaMobile (BOI12_mobile)C++17
100 / 100
731 ms36020 KiB
#include <bits/stdc++.h> using namespace std; long long n,x; vector<pair<long long,long long>> vec; int main() { cin>>n>>x; for (long long i=1;i<=n;i++) { long long xx,yy; cin>>xx>>yy; vec.push_back({xx,yy}); } double l=0.00; double r=1500000000.00; while (r-l>=0.0001) { double mid=(l+r)/2; double tren=0.00; for (long long i=0;i<n;i++) { double val=sqrt(mid*mid-vec[i].second*vec[i].second*1.00); double levo=vec[i].first*1.00-val; double desno=vec[i].first*1.00+val; if (levo<=tren) {tren=max(tren,desno);} } if (tren>=x*1.00) r=mid; else l=mid; } cout<<fixed<<showpoint<<setprecision(4)<<l<<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...