Submission #1010107

#TimeUsernameProblemLanguageResultExecution timeMemory
1010107Psiuk_YuriiMobile (BOI12_mobile)C++14
80 / 100
1076 ms32508 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll,ll> pll; typedef pair<ld,ld> pld; typedef pair<ll,pll> ppl; ll n; ld x[1000009],y[1000009],u,L,R,eps; bool can(ld R){ ld r=0.0; for(int i=1;i<=n;i++){ if(R>=y[i]){ ld x0=x[i]-sqrt(R*R-y[i]*y[i]); ld x1=x[i]+sqrt(R*R-y[i]*y[i]); if(x0<=r+eps) r=max(x1,r); if(r>=u-eps) return true; } } return false; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>n>>u; for(int i=1;i<=n;i++) cin>>x[i]>>y[i]; eps=0.0001; L=0.0; R=1000000000.0; while(L<R-eps){ ld mid=(L+R)*0.5; if(can(mid)) R=mid; else L=mid; } cout<<fixed<<setprecision(5)<<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...