Submission #920752

#TimeUsernameProblemLanguageResultExecution timeMemory
920752ethanv13Mobile (BOI12_mobile)C++17
0 / 100
727 ms24744 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 minimum=4e9; long double currub=4e9; for(int i=0;i<n;++i){ long double dist=sqrt(mid*mid-a[i].second*a[i].second); minimum=min(minimum,a[i].first-dist); if(a[i].first-dist<=currub){ currub=a[i].first+dist; } } if(currub>=l&&minimum<=0){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...