Submission #948283

#TimeUsernameProblemLanguageResultExecution timeMemory
948283AmaarsaaMobile (BOI12_mobile)C++14
0 / 100
411 ms32624 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long ; ll n, l; ll x[1000005], y[1000005]; bool Can(double R) { double D, x1, x2, mx = 0.0; for (int j = 1; j <= n; j ++) { D = (R - y[j]) * (R + y[j]); D = sqrt(D); x1 = x[j] - D; x2 = x[j] + D; if ( x1 > mx) return false; mx = max(mx,x2); } if ( mx < l) return false; return true; } int main() { ios::sync_with_stdio(false); cin.tie(NULL); ll i; double lo , hi, mid; cin >> n >> l; for (i = 1; i <= n; i ++) { cin >> x[i] >> y[i]; } lo = 0; hi = 2e9; for (i= 1; i <= 100;i ++) { mid = (lo + hi)/2; if (!Can(mid)) lo = mid; else hi = mid; } cout << lo << endl; }
#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...