제출 #1132108

#제출 시각아이디문제언어결과실행 시간메모리
1132108Adeeb_obedoMobile (BOI12_mobile)C++20
25 / 100
1095 ms8672 KiB
#include <bits/stdc++.h> #define int long long #define _1 first #define _2 second #define yes cout<<"Yes\n" #define nah cout<<"No\n" #define FFF ios_base::sync_with_stdio(0);cin.tie(0); #define ipr pair<int,int> #define ret return #define intt int32_t #define mid ((l+r)/2) #define pb push_back #define ll long long #define ld long double #define lll __int128_t using namespace std; int tst, ts; const intt mo = 1e9 + 7, dx[] = {-1, 1, 0, 0}, dy[] = {0, 0, -1, 1}; int mul( int x, int y ) { ret ( ( x % mo ) * ( y % mo ) ) % mo; ret x*y; } int pwo( int x, int y ) { int res = 1; for( int i = 63; i + 1; i-- ) res = mul( res, res * ( ( 1ll << i )&y ? x : 1 ) ); ret res; } int dvii( int x, int y ) { ret mul( x, pwo( y, mo - 2 ) ); } int oo( char x ) { ret ( int )x - '0'; } int lgg( int x, int y ) { int u = 0; while( x ) { u++; x /= y; } ret u; } int mun( int x, int y ) { while( x < y )x += mo; ret ( x - y ) % mo; } int add( int x, int y ) { ret x + y - ( mo * ( x + y >= mo ) ); ret x + y; } int lcm( int x, int y ) { ret ( x * y ) / __gcd( x, y ); } #define endl '\n' const int M = 2007, N = 2e5 + 7, N2 = 5e3 + 7, inf = 3e9+7; int n,L; ipr a[N]; pair<ld,ld>b[N]; ld get(ld x,ld y){ ld p=(x*x)-(y*y); p=(ld)sqrt(p); ret p; } int is(ld x){ int k=0; for(int i=0;i<n;i++) if(a[i]._1+get(x,a[i]._2)>=0)b[k]={a[i]._1-get(x,a[i]._2),a[i]._1+get(x,a[i]._2)},k++; sort(b,b+k); ld o=0; int i=0; while(i<k&&b[i]._1<=o) o=max(o,b[i]._2),i++; ret (o>=L); } void solve() { cin>>n>>L; for(int i=0;i<n;i++) cin>>a[i]._1>>a[i]._2; for(int i=0;i<n;i++) a[i]._2=abs(a[i]._2); ld l=0.0,r=inf+0.1; while(r-l>0.000001){ if(is(mid)) r=mid; else l=mid; } cout<<fixed<<setprecision(6)<<(ld)r<<endl; } intt main() { FFF/* freopen("convention2.in", "r", stdin); freopen("convention2.out", "w", stdout);/* for( int i = 2; i < N; i++ ) { if( sv[i] == 0 ) { for( int j = i + i; j < N; j += i ) sv[j] = 1; } } ff[0] = 1; for( int i = 1; i < N; i++ ) ff[i] = mul( ff[i - 1], i ); */ tst = 1; //cin >> tst; for( ts = 1; ts <= tst; ts++ ) { 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...