Submission #708951

#TimeUsernameProblemLanguageResultExecution timeMemory
708951mmaitiMobile (BOI12_mobile)C++11
0 / 100
1075 ms24652 KiB
#include <bits/stdc++.h> using namespace std; #define pii pair<int,int> vector<pii> coords; double eps = 1e-6; int N, L; bool works(double val) { double begin = 0; double end = L; for(int i = 0; i < N; i++) { if(val*val - coords[i].second*coords[i].second < 0) return false; double temp_begin = max((double)0,coords[i].first - pow(val*val - coords[i].second*coords[i].second,0.5)); double temp_end = min((double)L,coords[i].first + pow(val*val - coords[i].second*coords[i].second,0.5)); begin = max(temp_begin,begin); end = min(end,temp_end); if(begin>end) return false; } return true; } int main() { cin >> N >> L; coords.resize(N); for(int i = 0; i < N; i++) { cin >> coords[i].first >> coords[i].second; } double lo = 0; double hi = 1e11; double mid; while(abs(hi-lo) > eps) { mid = (lo + hi)/2; if(works(mid)) hi = mid; else lo = mid; } cout << lo; }
#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...