Submission #990610

#TimeUsernameProblemLanguageResultExecution timeMemory
990610SkaMobile (BOI12_mobile)C++14
100 / 100
388 ms35176 KiB
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 5; int n; double m; double x[N], y[N]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> n >> m; double l = 2e9, r = 1.5e9; for (int i = 1; i <= n; ++i) { cin >> x[i] >> y[i]; l = min(l, abs(y[i])); } while (r - l >= 1e-3) { double mid = (l + r) / 2; double cur = 0; for (int i = 1; i <= n; ++i) { if (mid < abs(y[i])) { continue; } double d = sqrt(mid * mid - y[i] * y[i]); double a = x[i] - d, b = x[i] + d; if (a <= cur) { cur = max(cur, b); } if (cur >= m) { break; } } if (cur >= m) { r = mid; } else { l = mid; } } cout << fixed << setprecision(6) << l << '\n'; }
#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...