Submission #708966

#TimeUsernameProblemLanguageResultExecution timeMemory
708966mmaitiMobile (BOI12_mobile)C++11
8 / 100
729 ms15956 KiB
#include <bits/stdc++.h> using namespace std; vector<pair<long long, long long>> coords; double eps = 1e-3; int N, L; bool not_works(double val) { double curr = 0; for(int i = 0; i < N; i++) { double temp_begin = coords[i].first - sqrt(val*val - coords[i].second*coords[i].second); double temp_end = coords[i].first + sqrt(val*val - coords[i].second*coords[i].second); 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 = 1; double hi = 1.5e9; 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...