Submission #914981

#TimeUsernameProblemLanguageResultExecution timeMemory
914981Em1LMobile (BOI12_mobile)C++14
0 / 100
966 ms16720 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 < int > 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] - sqrtl(dist * dist - y[i] * y[i]); double right = x[i] + sqrtl(dist * dist - y[i] * y[i]); if (r < left) return false; r = max(r, right); } return r > L; }; double l = 0, m, r = 2e+9; for (int i = 0; i < 100; i++) { m = (l + r) / 2; if (Good(m)) r = m; else l = m; } cout << setprecision(16) << fixed << r << "\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...