Submission #958946

#TimeUsernameProblemLanguageResultExecution timeMemory
958946biximoMobile (BOI12_mobile)C++17
0 / 100
638 ms8260 KiB
#include <bits/stdc++.h> #define N 1000005 using namespace std; typedef long long ll; typedef array<int, 2> p2; typedef long double ld; int n, L; p2 seq[N]; bool check(ld d) { ld l=0,r=L; for(int i = 0; i < n; i ++) { auto[h,k] = seq[i]; if(d*d-k*k < 0) return false; l = max(l,h-sqrt(d*d-k*k)); r = min(r,h+sqrt(d*d-k*k)); } return l <= r && r >= 0 && l <= L; } int main() { cin.tie(0)->sync_with_stdio(0); cin >> n >> L; for(int i = 0; i < n; i ++) { cin >> seq[i][0] >> seq[i][1]; } ld l=0,h=8e9,ans; for(int i = 0; i < 100; i++) { ld m=(l+h)/2; if(check(m)) { ans = m; h = m; } else { l = m; } } cout << setprecision(15) << ans; }
#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...