Submission #713021

#TimeUsernameProblemLanguageResultExecution timeMemory
713021Ahmed57Mobile (BOI12_mobile)C++14
100 / 100
998 ms30724 KiB
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3") #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); if(cur>=l)return 1; }return 0; } 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<60;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...