Submission #493540

#TimeUsernameProblemLanguageResultExecution timeMemory
493540imaginary_unitMobile (BOI12_mobile)C++17
100 / 100
448 ms16232 KiB
#include<bits/stdc++.h> #define ll long long #define fi first #define se second using namespace std; ll x[1'000'000], y[1'000'000]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, len; cin >> n >> len; for(int i=0; i<n; i++){ cin >> x[i] >> y[i]; } double l=1, r=1.5e9; while(r-l>1e-3){ double m=(l+r)/2, cur=0; for(int i=0; i<n; i++){ double delta=sqrt(m*m-y[i]*y[i]); double a=x[i]-delta, b=x[i]+delta; if(a<=cur){ cur=max(cur, b); } } if(cur>=len){ r=m; } else{ l=m; } } cout << fixed << setprecision(4) << l; 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...