Submission #678875

#TimeUsernameProblemLanguageResultExecution timeMemory
678875scrgeMobile (BOI12_mobile)C++17
0 / 100
267 ms3552 KiB
#include <bits/stdc++.h> using namespace std; int n, l; pair<double, double> base[100000]; bool check(double r){ pair<double, double> seg[100000]; for(int i = 0; i < n; i++){ double x = base[i].first, y = base[i].second; if(r*r < y*y) continue; double d = sqrt(r*r-y*y); seg[i] = {max((double)0, x-d), min(x+d, (double)l)}; } sort(seg, seg+n); double right = 0; for(int i = 0; i < n; i++){ if(seg[i].first > right) return true; right = max(right, seg[i].second); } return false; } int main(){ cin >> n >> l; for(int i = 0; i < n; i++) cin >> base[i].first >> base[i].second; double l = 0, r = 2e9; while(l+1e-4 < r){ double mid = (l+r)/2; if(check(mid)) l = mid; else r = mid; } cout << l << 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...