Submission #817163

#TimeUsernameProblemLanguageResultExecution timeMemory
817163MisterReaperMobile (BOI12_mobile)C++17
70 / 100
1089 ms35536 KiB
// author: MisterReaper (Ahmet Alp Orakci) #include <bits/stdc++.h> using namespace std; #define int long long #define double long double #define ONLINE_JUDGE #ifndef ONLINE_JUDGE #include "debug.h" #define OPEN freopen(".in", "r", stdin); freopen(".out", "w", stdout); #define TIME cerr << "\n" << fixed << setprecision(2) << 1000.0 * clock() / CLOCKS_PER_SEC << " milliseconds "; #else #define debug(...) void(23) #define debugarr(...) void(23) #define OPEN void(0000) #define TIME void(232323233) #endif void solve() { int n, m; cin >> n >> m; pair <double, double> arr[n]; for(auto &i : arr) cin >> i.first >> i.second; auto check = [&](double mid) -> bool { double cur = 0;; for(auto &i : arr) { double delta = sqrtl(mid * mid - i.second * i.second); double nl = i.first - delta; if(nl <= cur) cur = max(cur, i.first + delta); } return ((double) m <= cur); }; double l = 0, r = 1e10, res = 0; while((r - l) >= 1e-9) { debug(l, r); double mid = (l + r) / 2; if(check(mid)) { r = mid; res = mid; } else l = mid; } cout << fixed << setprecision(10) << res; cerr << fixed << setprecision(10) << res; return; } int32_t main() { OPEN; ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int t = 1; //cin >> t; while(t--) { solve(); } TIME; 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...