Submission #1066369

#TimeUsernameProblemLanguageResultExecution timeMemory
1066369JohnnyVenturasMobile (BOI12_mobile)C++17
12 / 100
600 ms8152 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e6; struct point { int 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 low = 2e9, 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) { low = min(low, left); high = max(high, right); } } return low <= 0 && 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...