Submission #1131817

#TimeUsernameProblemLanguageResultExecution timeMemory
1131817Adeeb_obedoMobile (BOI12_mobile)C++20
0 / 100
1096 ms16888 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 = 1e18; int n,L; ipr a[N]; ld get(ld x,ld y){ ld p=(x*x)-(y*y); p=(ld)sqrt(p); ret p; } int is(ld x){ vector<pair<ld,ld>>v; for(int i=0;i<n;i++) v.pb({a[i]._1-get(x,a[i]._2),a[i]._1+get(x,a[i]._2)}); sort(v.begin(),v.end()); ld o=0; int i=0; while(i<v.size()&&v[i]._1<=o+0.000001) o=max(o,v[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; ld l=0.0,r=10000000000.0; 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...