Submission #1095199

#TimeUsernameProblemLanguageResultExecution timeMemory
1095199KodikMobile (BOI12_mobile)C++17
100 / 100
391 ms35408 KiB
#include <bits/stdc++.h> using namespace std; #define ss second #define ff first typedef long long ll; typedef long double ld; #define int ll pair<ll,ll> bases[1000000]; signed main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int n, l; cin >> n >> l; for(int i = 0; i < n; ++i){ cin >> bases[i].ff >> bases[i].ss; } double left = 1, right = 2e9; while(right-left>1e-4){ double mid = left + (right-left)/2; double curr = 0; for(int i = 0; i < n; ++i){ double hi_range = sqrt(mid*mid-bases[i].ss*bases[i].ss); double start = bases[i].ff-hi_range, end = bases[i].ff+hi_range; if(start<=curr) curr = max(curr, end); } if(curr>=l){ right = mid; }else{ left = mid; } } cout << fixed << setprecision(3) << right; return 0; }
#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...