Submission #958778

#TimeUsernameProblemLanguageResultExecution timeMemory
958778Trisanu_DasMobile (BOI12_mobile)C++17
100 / 100
348 ms35428 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define ff first #define ss second signed main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int n, L; cin >> n >> L; pair<int, int> p[n]; for(int i = 0; i < n; i++) cin >> p[i].ff >> p[i].ss; double l = 1, r = 1.5e9; while(r - l > 1e-3){ double mid = (l + r) / 2, chk = 0; for(int i = 0; i < n; i++){ double d = sqrt(mid * mid - p[i].ss * p[i].ss); double a = p[i].ff - d, b = p[i].ff + d; if(a <= chk) chk = max(chk, b); } if(chk >= 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...