Submission #973944

#TimeUsernameProblemLanguageResultExecution timeMemory
973944andrewpMobile (BOI12_mobile)C++14
50 / 100
47 ms2224 KiB
//Dedicated to my love,ivaziva #pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define ll long long #define dbg(x) cerr<<#x<<": "<<x<<endl; #define pb push_back #define fi first #define se second #define mp make_pair #define mt make_tuple #define pii pair<int,int> #define pll pair<ll,ll> #define ldb double const ll inf=(ll)1e18+5; const int mod=1e9+7; const int K=512; const int L=30; const int N=1e5+1; int n,l; pll a[N]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>n>>l; for(int i=0;i<n;i++) cin>>a[i].fi>>a[i].se; ldb bot=1,top=(ldb)1.5e9; while(top-bot>0.000001) { ldb mid=(bot+top)/2.0; ldb calc=0; for(int i=0;i<n;i++) { ldb razl=sqrt(mid*mid-(ldb)(a[i].se*a[i].se)); ldb x=a[i].fi-razl; ldb y=a[i].fi+razl; if(x<=calc) { calc=max(calc,y); } } if(calc>=l) top=mid; else bot=mid; } cout<<fixed<<setprecision(6)<<bot; 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...