Submission #920756

#TimeUsernameProblemLanguageResultExecution timeMemory
920756ethanv13Mobile (BOI12_mobile)C++17
100 / 100
410 ms35408 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long n,l;cin>>n>>l; vector<pair<long long,long long>>a(n); for(int i=0;i<n;++i){ cin>>a[i].first>>a[i].second; } double lo=0; double hi=4e9; double delta=1e-5; while(hi-lo>delta){ double mid=(lo+hi)/2; double curr=0; for(int i=0;i<n;++i){ 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...