Submission #781094

#TimeUsernameProblemLanguageResultExecution timeMemory
781094upedMobile (BOI12_mobile)C++14
100 / 100
367 ms35300 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 = 1.5e9; while (r - l > 1e-3) { double radius = (l + r) / 2.0; double cur = 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 <= cur) cur = max(x + a, cur); } if (cur >= 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...