Submission #1024279

#TimeUsernameProblemLanguageResultExecution timeMemory
1024279angelsMobile (BOI12_mobile)C++14
100 / 100
339 ms15964 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long int n, L; cin>>n>>L; vector<pair<long long, long long>>v(n); for(int i=0; i<n; i++) { cin>>v[i].first>>v[i].second; } double l=1, r=1.0e9; while(r-l>1e-3) { double mid=(l+r)/2; double granica=0; for(int i=0; i<n; i++) { double opseg=sqrt(mid*mid-v[i].second*v[i].second); double minn=v[i].first-opseg; double maxx=v[i].first+opseg; if(minn<=granica) { granica=max(granica, maxx); } } if(granica<L) { l=mid; } else r=mid; } cout<<fixed<<setprecision(4)<<l; return 0; }
#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...