Submission #829479

#TimeUsernameProblemLanguageResultExecution timeMemory
829479soumyojit_senMobile (BOI12_mobile)C++14
0 / 100
663 ms24616 KiB
#include <bits/stdc++.h> using namespace std; vector<pair<int,int>> pts; int n,L; bool works(double d){ double left = DBL_MIN, right = DBL_MAX; for(int i = 0; i < n; i++){ left = max(left, pts[i].first - sqrt(d*d - pts[i].second*pts[i].second)); right = min(right, pts[i].first + sqrt(d*d - pts[i].second*pts[i].second)); } return left <= right; } int main() { cin >> n >> L; pts.resize(n); for(int i = 0; i < n; i++) cin >> pts[i].first >> pts[i].second; double bad = -1.0; double good = 2e9; for(int i = 0; i < 60; i++){ double mid = bad + (good - bad)/2.0; if(works(mid)){ good = mid; } else { bad = mid; } } cout << fixed << setprecision(6) << good; }
#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...