Submission #973951

#TimeUsernameProblemLanguageResultExecution timeMemory
973951andrewpMobile (BOI12_mobile)C++14
50 / 100
33 ms3676 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; ll 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.00,top=(ldb)1.5e9; while(top-bot>1e-3) { ldb mid=(bot+top)/2,calc=0; for(int i=0;i<n;i++) { ldb razl=sqrt((ldb)(mid*mid)-(ldb)(a[i].se*a[i].se)); ldb x=(ldb)a[i].fi-razl; ldb y=(ldb)a[i].fi+razl; if(x<=calc) { calc=max(calc,y); } } if(calc>=(ldb)l) top=mid; else bot=mid; } cout<<fixed<<setprecision(4)<<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...