Submission #834294

#TimeUsernameProblemLanguageResultExecution timeMemory
834294Darren0724Mobile (BOI12_mobile)C++17
100 / 100
789 ms35264 KiB
#include<bits/stdc++.h> using namespace std; #define int long long int32_t main(){ int n,len;cin>>n>>len; vector<int> x(n),y(n); for(int i=0;i<n;i++){ cin>>x[i]>>y[i]; } double l=0,r=2e9,m; int t=60; while(t--){ m=(l+r)/2; double now=0; for(int i=0;i<n;i++){ double d=m*m-y[i]*y[i]; if(d<0){ continue; } d=sqrtl(d); if(x[i]-d<=now&&x[i]+d>=now){ now=x[i]+d; } } if(now>=len){ r=m; } else{ l=m; } } cout<<fixed<<setprecision(9)<<r<<endl; 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...