Submission #973124

#TimeUsernameProblemLanguageResultExecution timeMemory
973124njoopMobile (BOI12_mobile)C++17
0 / 100
601 ms34032 KiB
#include <bits/stdc++.h> #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #define pi pair<double, double> using namespace std; double x, y, L, l=0, r=1e9, mid, de, cov; pi arr[1000010]; vector<pi> in; int n; bool solve(double rad) { in.clear(); cov = 0; for(int i=1; i<=n; i++) { de = sqrt(rad*rad - arr[i].second*arr[i].second); if(de < 0) continue; in.push_back({arr[i].first-de, arr[i].first+de}); } for(auto i: in) { if(i.first > cov) return 0; cov = max(cov, i.second); if(cov >= L) return 1; } return 0; } int main() { cin.tie(0)->sync_with_stdio(0); cin >> n >> L; for(int i=1; i<=n; i++) { cin >> arr[i].first >> arr[i].second; } while(l+0.0001 < r) { mid = (l+r)/2; if(solve(mid)) { r = mid; } else { l = mid + 0.0001; } } cout << fixed << setprecision(6) << l; 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...