Submission #838864

#TimeUsernameProblemLanguageResultExecution timeMemory
838864SnowRaven52Mobile (BOI12_mobile)C++17
100 / 100
397 ms35208 KiB
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, len; cin >> n >> len; vector<pair<long long, long long>> v(n); for (int i = 0; i < n; ++i) { int a, b; cin >> a >> b; v[i] = {a, b}; } double l = 0.0, r = 2e9; while (r - l > 1e-3) { double radius = (l + r) / 2.0; double mx = 0; for (int j = 0; j < n; j++) { long long x = v[j].first; long long 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 << setprecision(20) << r; 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...