제출 #720552

#제출 시각아이디문제언어결과실행 시간메모리
720552hailMobile (BOI12_mobile)C++17
100 / 100
706 ms35400 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back #define fast_io ios::sync_with_stdio(0); cin.tie(0) #define int long long #define pi pair<int, int> #define mp make_pair #define ld long double #define fi first #define se second #define db double const int MODa = 7 + (int)1e9; const int INF = (int)4e18; const int MOD = 998244353; int n, l; const int MXN = 1000005; int x[MXN]{}; int y[MXN]{}; bool check(db r) { db mx = 0; db rr = r*r; //cerr<<"r = "<<r<<"\n"; for(int i=1; i<=n; i++) { if(r<y[i]) continue; db sqv = sqrtl(rr - y[i]*y[i]); if(x[i]-sqv>mx) continue; mx = max(mx, x[i]+sqv); //cerr<<i<<" "<<mx<<"\n"; if(mx>=l) return true; } return false; } void solve() { cin>>n>>l; for(int i=1; i<=n; i++) { cin>>x[i]>>y[i]; } db high = 6e9; db low = 0; while(high-low>0.001) { db mid = (high+low)/2; if(check(mid)) high = mid; else low = mid; } cout<<setprecision(30); cout<<low<<"\n"; } signed main() { fast_io; int t=1; //cin>>t; while(t--) { solve(); } }
#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...