Submission #1066375

#TimeUsernameProblemLanguageResultExecution timeMemory
1066375JohnnyVenturasMobile (BOI12_mobile)C++17
100 / 100
839 ms15976 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e6; struct point { long long x, y; }; point receivers[MAXN]; double first_true(double low, double high, function<bool(double)> f) { --low, ++high; double mid; while (high - low > 1e-3) { mid = low + (high - low) /2; if (f(mid)) { high = mid; } else { low = mid; } } return high; } int main() { int n, l; cin >> n >> l; for (int i = 0; i < n; ++i) { cin >> receivers[i].x >> receivers[i].y; } cout << fixed << setprecision(4) << first_true(0, 2e9, [&](double r) { double high = 0; for (int i = 0; i < n; ++i) { double left = receivers[i].x - sqrt(r * r - receivers[i].y * receivers[i].y); double right = receivers[i].x + sqrt(r * r - receivers[i].y * receivers[i].y); if (left <= high) { high = max(high, right); } } return high >= l; }); }
#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...