Submission #965001

#TimeUsernameProblemLanguageResultExecution timeMemory
965001pccMobile (BOI12_mobile)C++17
35 / 100
1093 ms81576 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll,ll> #define pii pair<int,int> #define fs first #define sc second #define tlll tuple<ll,ll,ll> #define ld long double #define pld pair<ld,ld> const int mxn = 1e6+10; ll N,L; pair<ll,ll> arr[mxn]; inline bool check(ld r){ vector<pld> v; for(int i = 0;i<N;i++){ if(r<abs(arr[i].sc))continue; v.push_back(pld(arr[i].fs-sqrt(r*r-arr[i].sc*arr[i].sc),arr[i].fs+sqrt(r*r-arr[i].sc*arr[i].sc))); } sort(v.begin(),v.end()); ld pre = 0; for(auto &i:v){ if(pre>L)return true; if(pre<i.fs)return false; pre = max(pre,i.sc); } return pre>L; } int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); ld l = 0,r = 2e9; cin>>N>>L; for(int i = 0;i<N;i++)cin>>arr[i].fs>>arr[i].sc; for(int i = 0;i<100;i++){ ld mid = (l+r)/2; if(check(mid))r = mid; else l = mid; } cout<<fixed<<setprecision(10)<<l<<'\n'; 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...