제출 #713017

#제출 시각아이디문제언어결과실행 시간메모리
713017Ahmed57Mobile (BOI12_mobile)C++14
90 / 100
1081 ms16140 KiB
#include <bits/stdc++.h> using namespace std; pair<double,double> cordinates[1000001]; int n;double l; bool ch(double mid){ double cur = 0,x,begi,en; for(int i =0;i<n;i++){ if(cordinates[i].second>mid)continue; x = sqrt((mid*mid)-(cordinates[i].second*cordinates[i].second)); begi = cordinates[i].first-x; en = cordinates[i].first+x; if(begi<=cur)cur = max(cur,en); } return (cur>=l); } int main(){ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); cin>>n>>l; for(int i = 0;i<n;i++){ cin>>cordinates[i].first>>cordinates[i].second; } double l = 0.0 ,r = 1000000000.0; for(int i = 0;i<75;i++){ double mid=(l+r)/2.0; if(ch(mid))r = mid; else l = mid; } cout<<setprecision(9)<<fixed<<r<<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...