Submission #1063747

#TimeUsernameProblemLanguageResultExecution timeMemory
1063747davieduMobile (BOI12_mobile)C++17
90 / 100
1032 ms51072 KiB
#include <bits/stdc++.h> using namespace std; #define fastio ios_base::sync_with_stdio(0); cin.tie(0) #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define ll long long #define ld long double struct P{ ll x, y; }; void dbg_out() { cerr << endl; } template <typename H, typename... T> void dbg_out(H h, T... t) { cerr << ' ' << h; dbg_out(t...); } #define dbg(...) { cerr << #__VA_ARGS__ << ':'; dbg_out(__VA_ARGS__); } const ld prec = 0.0001; const ld MX = 1e10; vector<pair<ld, ld>> points; int n, len; bool f(ld r){ ld right=0; for (auto& [x, y]: points){ if (r < y) continue; ld dx = sqrtl(r*r - y*y); if (x-dx <= right) right = max(right, x+dx); } return right >= len; } signed main(){ fastio; cin >> n >> len; points.resize(n); for (int i=0; i<n; i++){ cin >> points[i].first; cin >> points[i].second; } ld l=0, r=MX, ans=MX; while (r-l >= prec){ ld m = (l+r)/2; if (f(m)) r = m, ans = m; else l = m; } cout << fixed << setprecision(13); cout << ans << '\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...