Submission #1095193

#TimeUsernameProblemLanguageResultExecution timeMemory
1095193KodikMobile (BOI12_mobile)C++17
80 / 100
1074 ms50776 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 signed main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); ld n, l; cin >> n >> l; vector<pair<ld,ld>> bases(n); for(int i = 0; i < n; ++i){ ld x, y; cin >> x >> y; bases[i] = {x,y}; } ld left = 0, right = 2e9; while(right-left>1e-4){ ld mid = left + (right-left)/2; ld curr = 0; for(auto &[x, y] : bases){ ld hi_range = sqrt(mid*mid-y*y); ld start = x-hi_range, end = x+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...