Submission #1130329

#TimeUsernameProblemLanguageResultExecution timeMemory
1130329liangjeremyMobile (BOI12_mobile)C++20
0 / 100
1096 ms31812 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double lb; int n,l; vector<pair<lb,lb>>a; bool check(lb radius){ lb start=0; for(int i=0; i<n; i++){ lb left=a[i].first-sqrt(radius*radius-a[i].second*a[i].second); lb right=sqrt(radius*radius-a[i].second*a[i].second)+a[i].first; if(left>start)return false; start=max(start,right); } if(start<l)return false; return true; } int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>n>>l; a.resize(n); for(int i=0; i<n; i++){ cin>>a[i].first>>a[i].second; } lb left=0; lb right=2*(1e9); lb prec=1e-5; while(right-left>prec){ lb mid=(left+right)/2; if(check(mid))right=mid; else left=mid+prec; } cout<<fixed<<setprecision(5)<<left<<'\n'; }
#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...