QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#54384#968. Extreme WealthtricyzhkxWA 2ms3708kbC++14561b2022-10-08 11:07:132022-10-08 11:07:15

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-08 11:07:15]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3708kb
  • [2022-10-08 11:07:13]
  • 提交

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