QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#54384 | #968. Extreme Wealth | tricyzhkx | WA | 2ms | 3708kb | C++14 | 561b | 2022-10-08 11:07:13 | 2022-10-08 11:07:15 |
Judging History
answer
# include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
int main()
{
ll n,m;
cin>>n>>m;
if(n>m) swap(n,m);
if(m<=1e7)
{
ld ans=1;
for(int i=1,j=1;i<=n+m;i++)
{
ans*=2;
for(;ans>1 && j<=m;j++) ans/=n+j,ans*=j;
if(ans>1e9) puts("Extreme Wealth");
}
printf("%.10Lf\n",ans);
return 0;
}
ld ans=sqrtl(acosl(-1)*n)*(1+1/(ld)(8*n));
for(ll i=n;i<m;i++)
{
ans=ans*2.0l*(i+1)/(i+n+1);
if(ans>1e9) return puts("Extreme Wealth"),0;
}
printf("%.10Lf\n",ans);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3704kb
input:
3 2
output:
3.2000000000
result:
ok OK 3.20000000, real ans = 3.20000000, error = 0.00000000
Test #2:
score: 0
Accepted
time: 1ms
memory: 3708kb
input:
0 29
output:
536870912.0000000000
result:
ok OK 536870912.00000000, real ans = 536870912.00000000, error = 0.00000000
Test #3:
score: -100
Wrong Answer
time: 2ms
memory: 3640kb
input:
30 0
output:
Extreme Wealth 1073741824.0000000000
result:
wrong output format Extra information in the output file