Submission #493539

#TimeUsernameProblemLanguageResultExecution timeMemory
493539imaginary_unitMobile (BOI12_mobile)C++17
100 / 100
428 ms18148 KiB
#include<bits/stdc++.h> #define ll long long #define x first #define y second using namespace std; pair<ll, ll> p[1'000'000]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, len; cin >> n >> len; for(int i=0; i<n; i++){ cin >> p[i].x >> p[i].y; } double l=1, r=1.5e9; while(r-l>1e-3){ double m=(l+r)/2, cur=0; for(int i=0; i<n; i++){ double delta=sqrt(m*m-p[i].y*p[i].y); double a=p[i].x-delta, b=p[i].x+delta; if(a<=cur){ cur=max(cur, b); } } if(cur>=len){ r=m; } else{ l=m; } } cout << fixed << setprecision(4) << 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...