Submission #1059391

#TimeUsernameProblemLanguageResultExecution timeMemory
1059391ssitaramMobile (BOI12_mobile)C++17
100 / 100
570 ms51076 KiB
#include <bits/stdc++.h> using namespace std; typedef long double ld; int main() { ios::sync_with_stdio(0); cin.tie(nullptr); int n; cin >> n; ld ll; cin >> ll; ld lo = 0, hi = 1e12; vector<pair<ld, ld>> poi(n); for (int i = 0; i < n; ++i) cin >> poi[i].first >> poi[i].second; while (hi - lo > 1e-4) { ld mi = (lo + hi) / 2; ld till = 0; for (int i = 0; i < n; ++i) { if (mi * mi - poi[i].second * poi[i].second < 0) continue; ld sq = sqrt(mi * mi - poi[i].second * poi[i].second); ld h = sq + poi[i].first; ld l = - sq + poi[i].first; if (l <= till) { till = max(till, h); } } if (till >= ll) { hi = mi; } else { lo = mi; } } cout << fixed << setprecision(3) << lo << '\n'; return 0; }
#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...