Submission #670285

#TimeUsernameProblemLanguageResultExecution timeMemory
670285RadicaIMobile (BOI12_mobile)C++17
100 / 100
971 ms15952 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ int n,siz; cin >> n>>siz; pair<ll, ll> stations[n]; for(int i=0; i<n; i++) cin >> stations[i].first >> stations[i].second; double l = 1; double r = 1.5e9; while(r - l > 1e-3){ double m = (l+r)/2.0; double store=0; for(int i=0; i<n; i++){ if(abs(stations[i].second) <=m){ double change = sqrt(m*m-stations[i].second*stations[i].second); double ph = stations[i].first + change; double pl = stations[i].first - change; if(pl<=store) store = max(store, ph); } } if(store>=siz) r=m; else l=m; } cout << fixed << setprecision(4)<< l; }
#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...