Submission #888116

#TimeUsernameProblemLanguageResultExecution timeMemory
888116eysbutnoMobile (BOI12_mobile)C++17
4 / 100
341 ms8284 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pii = pair<int, int>; #define all(x) begin(x), end(x) #define ckmax(a, b) a = max(a, b) #define ckmin(a, b) a = min(a, b) #define pb push_back #define ins insert #define f first #define s second int main() { cin.tie(0) -> sync_with_stdio(0); int n, l; cin >> n >> l; vector<pii> loc(n); for (auto& i : loc) { cin >> i.f >> i.s; } auto len = [&](ld d, ld y) { return sqrt(d * d - y * y); }; auto check = [&](ld d) { ld far = 0; for (int i = 0; i < n; i++) { if (d < abs(loc[i].s)) { continue; } ld dx = len(d, loc[i].s); ld l = loc[i].f - dx, r = loc[i].f + dx; if (l <= far) ckmax(far, r); } return far >= l; }; ld low = 0, high = 1.5e9, prec = 1e-3; while (high - low > prec) { ld mid = (low + high) / 2; if (check(mid)) { high = mid; } else { low = mid; } } cout << setprecision(4); cout << low << '\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...