Submission #916410

#TimeUsernameProblemLanguageResultExecution timeMemory
916410codefoxMobile (BOI12_mobile)C++14
4 / 100
328 ms15964 KiB
#include<bits/stdc++.h> using namespace std; #define double long double #define ll long long #define pii pair<ll, ll> #define pdd pair<double, double> double prec = 1e6; int main() { ios_base::sync_with_stdio(false); cin.tie(0); //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); cout << setprecision(5); int n, l; cin >> n >> l; vector<pii> stations(n); for (int i = 0; i < n; i++) { int a, b; cin >> a >> b; stations[i] = {a, b}; } double dist = 0; ll one = 1; for (int i = 50; i >= 0; i--) { dist += (one<<i)/prec; double highest = 0; for (pii ele:stations) { double dy = ele.second*ele.second; double diff = dist*dist-dy; if (diff <= 0) continue; double dx = sqrt(diff); double f = ele.first-dx; double s = ele.first+dx; if (f < highest) highest = max(highest, s); } if (highest < l) continue; dist -= (one<<i)/prec; } cout << dist << "\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...