Submission #708955

#TimeUsernameProblemLanguageResultExecution timeMemory
708955mmaitiMobile (BOI12_mobile)C++11
8 / 100
1071 ms8696 KiB
#include <bits/stdc++.h> using namespace std; #define pii pair<int,int> vector<pii> coords; double eps = 1e-5; int N, L; bool not_works(double val) { double curr = 0; for(int i = 0; i < N; i++) { double temp_begin = coords[i].first - pow(val*val - coords[i].second*coords[i].second,0.5); double temp_end = coords[i].first + pow(val*val - coords[i].second*coords[i].second,0.5); if(temp_begin < curr) curr = max(curr, temp_end); } if(curr >= L) return true; else return false; } 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 = 1e10; double mid; while(abs(hi-lo) > eps) { mid = (lo + hi)/2; if(not_works(mid)) hi = mid; else lo = mid; } cout << setprecision(6) << lo << "\n"; }
#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...