Submission #168839

#TimeUsernameProblemLanguageResultExecution timeMemory
168839MohamedAhmed04Mobile (BOI12_mobile)C++14
100 / 100
961 ms8268 KiB
#include <bits/stdc++.h> using namespace std ; const int MAX = 1e6 + 10 ; int x[MAX] , y[MAX] ; int n , l; double a , b , now; bool check(double radius) { now = 0.00 ; for(int i = 0 ; i < n ; ++i) { a = sqrt(radius * radius - ((-y[i] * 1ll) * (-y[i] * 1ll))) + x[i] * 1ll ; b = -sqrt(radius * radius - ((-y[i] * 1ll) * (-y[i] * 1ll))) + x[i] * 1ll ; if(a > b) swap(a , b) ; if(a <= now) now = max(now , b) ; } return (now >= l) ; } int main() { ios_base::sync_with_stdio(0) ; cin.tie(0) ; cin>>n>>l ; for(int i = 0 ; i < n ; ++i) cin>>x[i]>>y[i] ; double low = 0.000 , high = 1e9 ; double ans = high ; for(int i = 0 ; i < 41 ; ++i) { double mid = (low + high) / 2.00 ; if(check(mid)) ans = mid , high = mid ; else low = mid ; } return cout<<fixed<<setprecision(6)<<ans<<"\n" , 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...