Submission #781095

#TimeUsernameProblemLanguageResultExecution timeMemory
781095upedMobile (BOI12_mobile)C++14
100 / 100
358 ms15956 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long; void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fastio(); int n, len; cin >> n >> len; vector<pair<ll, ll>> v(n); for (int i = 0; i < n; ++i) { int a, b; cin >> a >> b; v[i] = {a, b}; } double l = 0.0, r = 1e10; while (r - l > 1e-3) { double radius = (l + r) / 2.0; double mx = 0; for (int j = 0; j < n; ++j) { ll x = v[j].first; ll y = v[j].second; double a = sqrt( radius * radius - y * y); if (x - a <= mx) { mx = max(x + a, mx); } } if (mx >= len) { r = radius; } else { l = radius; } } cout << fixed << setprecision(4) << l; 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...