Submission #920753

#TimeUsernameProblemLanguageResultExecution timeMemory
920753ethanv13Mobile (BOI12_mobile)C++17
12 / 100
692 ms8276 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n,l;cin>>n>>l; vector<pair<int,int>>a(n); for(int i=0;i<n;++i){ cin>>a[i].first>>a[i].second; } long double lo=0; long double hi=4e9; long double delta=1e-5; while(hi-lo>delta){ long double mid=(lo+hi)/2; long double curr=0; for(int i=0;i<n;++i){ long double dist=sqrt(mid*mid-a[i].second*a[i].second); if(a[i].first-dist<=curr){curr=max(a[i].first+dist,curr);} } if(curr>=l){hi=mid;}else{lo=mid;} } cout<<fixed<<setprecision(5); cout<<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...