Submission #669101

#TimeUsernameProblemLanguageResultExecution timeMemory
669101hanlei35Mobile (BOI12_mobile)C++17
100 / 100
462 ms35228 KiB
#include <iostream> #include <cmath> #include <iomanip> using ll = long long; using namespace std; int N, L; pair<ll,ll> xy[1000005]; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); cin >> N >> L; for(int i=0;i<N;i++){ cin >> xy[i].first >> xy[i].second; } double l = 1, r = 1.5E9; while(r - l > 1E-4){ double mid = (l+r)/2, curr = 0; for(int i=0;i<N;i++){ double delta = sqrt(mid*mid - xy[i].second * xy[i].second); double a = xy[i].first - delta, b = xy[i].first + delta; if(a<=curr) curr = max(curr,b); } if(curr >= L) r = mid; else l = mid; } cout << fixed << setprecision(4) << l << "\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...