Submission #919371

#TimeUsernameProblemLanguageResultExecution timeMemory
919371ethanv13Mobile (BOI12_mobile)C++17
0 / 100
1039 ms65968 KiB
#include <bits/stdc++.h> using namespace std; vector<pair<long long,long long>>c;long long n,l; bool can(long double mid){ vector<pair<long double,long double>>seg; for(int i=0;i<n;++i){ if(mid<abs(c[i].second)){ return false; } else { long double delta=sqrt(mid*mid-c[i].second*c[i].second); seg.push_back({c[i].first-delta,c[i].first+delta}); } } long double currub=0; for(int i=0;i<n;++i){ if(seg[i].first<=currub){ currub=max(currub,seg[i].second); } } return currub>=l; } int main() { cin>>n>>l; for(int i=0;i<n;++i){ long long x,y;cin>>x>>y;c.push_back({x,y}); } long double lo=0;long double hi=2e9; for(int i=0;i<45;++i){ long double mid=(lo+hi)/2; if(can(mid)){ hi=mid; } else { lo=mid; } } cout<<fixed<<setprecision(9); 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...