Submission #973935

#TimeUsernameProblemLanguageResultExecution timeMemory
973935andrewpMobile (BOI12_mobile)C++14
50 / 100
35 ms5560 KiB
//Dedicated to my love,ivaziva #pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define ll long long #define dbg(x) cerr<<#x<<": "<<x<<endl; #define pb push_back #define fi first #define se second #define mp make_pair #define mt make_tuple #define pii pair<int,int> #define pll pair<ll,ll> #define ldb double const ll inf=(ll)1e18+5; const int mod=1e9+7; const int K=512; const int L=30; const int N=1e5+1; ll n,l; pll a[N]; int main() { scanf("%lld%lld",&n,&l); for(int i=0;i<n;i++) scanf("%lld%lld",&a[i].fi,&a[i].se); ldb bot=1,top=(ldb)1.5e9; while(top-bot>1e-3) { ldb mid=(bot+top)/2.0; ldb calc=0; for(int i=0;i<n;i++) { ldb razl=sqrt(mid*mid-a[i].se*a[i].se); ldb x=a[i].fi-razl; ldb y=a[i].fi+razl; if(x<=calc) { calc=max(calc,y); } } if(calc>=l) top=mid; else bot=mid; } cout<<fixed<<setprecision(4)<<bot; return 0; }

Compilation message (stderr)

mobile.cpp: In function 'int main()':
mobile.cpp:24:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |     scanf("%lld%lld",&n,&l);
      |     ~~~~~^~~~~~~~~~~~~~~~~~
mobile.cpp:25:28: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   25 |  for(int i=0;i<n;i++) scanf("%lld%lld",&a[i].fi,&a[i].se);
      |                       ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...