Submission #914989

#TimeUsernameProblemLanguageResultExecution timeMemory
914989Em1LMobile (BOI12_mobile)C++17
100 / 100
617 ms26088 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using tiiii = tuple<int, int, ll, ll>; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, L; cin >> n >> L; vector < ll > x(n), y(n); for (int i = 0; i < n; i++) cin >> x[i] >> y[i]; auto Good = [&](double dist) { double r = 0; for (int i = 0; i < n; i++) { if (y[i] > dist) continue; double left = x[i] - sqrt(dist * dist - y[i] * y[i]); double right = x[i] + sqrt(dist * dist - y[i] * y[i]); if (left <= r) r = max(r, right); } return r >= L; }; double l = 1, m, r = 2e+9; while (r - l > 1e-3) { m = (l + r) / 2; if (Good(m)) r = m; else l = m; } cout << setprecision(4) << fixed << (l + r) / 2 << "\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...