Submission #670287

#TimeUsernameProblemLanguageResultExecution timeMemory
670287RadicaIMobile (BOI12_mobile)C++17
4 / 100
886 ms15948 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ cout.precision(4); 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 << 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...