QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#87871#968. Extreme WealtheyiigjknWA 6ms3700kbC++14548b2023-03-14 16:50:412023-03-14 16:50:42

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-14 16:50:42]
  • 评测
  • 测评结果:WA
  • 用时:6ms
  • 内存:3700kb
  • [2023-03-14 16:50:41]
  • 提交

answer

# include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
constexpr int B=1e7;
constexpr ld pi=acos(-1),INF=1e9;
int main()
{
	ll x,y;
	ld ans;
	cin>>x>>y;
	if(x>y) swap(x,y);
	if(y-x>B) return puts("Extreme Wealth"),0;
	if(x<=B)
	{
		ans=(ld)(x+y)*log(2);
		for(int i=1;i<=x;i++) ans+=log(i)-log(i+y);
		ans=exp(ans);
	}
	else
	{
		ans=sqrtl(2*pi*(x+y))/2;
		for(ll i=(x+y)/2;i>x;i--) ans*=(ld)(x+y-i+1)/i;
	}
	if(ans<=INF) printf("%.8Lf\n",ans);
	else puts("Extreme Wealth");
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3592kb

input:

3 2

output:

3.20000000

result:

ok OK 3.20000000, real ans = 3.20000000, error = 0.00000000

Test #2:

score: 0
Accepted
time: 2ms
memory: 3492kb

input:

0 29

output:

536870911.99999964

result:

ok OK 536870911.99999964, real ans = 536870912.00000000, error = 0.00000000

Test #3:

score: 0
Accepted
time: 2ms
memory: 3360kb

input:

30 0

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1073741824.00000000

Test #4:

score: 0
Accepted
time: 2ms
memory: 3576kb

input:

37 73

output:

5028.48885958

result:

ok OK 5028.48885958, real ans = 5028.48885958, error = 0.00000000

Test #5:

score: 0
Accepted
time: 2ms
memory: 3436kb

input:

10000000000 10000000000

output:

177245.38509055

result:

ok OK 177245.38509055, real ans = 177245.38509055, error = 0.00000000

Test #6:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

10000000000 9999412550

output:

989753719.13243657

result:

ok OK 989753719.13243651, real ans = 989753719.13242424, error = 0.00000000

Test #7:

score: 0
Accepted
time: 0ms
memory: 3640kb

input:

10000000000 9999412400

output:

994124819.34331768

result:

ok OK 994124819.34331763, real ans = 994124819.34340525, error = 0.00000000

Test #8:

score: 0
Accepted
time: 2ms
memory: 3440kb

input:

10000000000 9999412200

output:

999984746.74203586

result:

ok OK 999984746.74203587, real ans = 999984746.74201429, error = 0.00000000

Test #9:

score: 0
Accepted
time: 1ms
memory: 3364kb

input:

10000000000 9999412199

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1000014138.02130949

Test #10:

score: 0
Accepted
time: 2ms
memory: 3176kb

input:

10000000000 9999411862

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1009971237.25187039

Test #11:

score: 0
Accepted
time: 0ms
memory: 3280kb

input:

10000000000 9999411861

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1010000939.12199187

Test #12:

score: 0
Accepted
time: 2ms
memory: 3444kb

input:

1000000000 100000000

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 2000288524.07298231

Test #13:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

999900000 999999999

output:

682861.86134973

result:

ok OK 682861.86134973, real ans = 682861.86152047, error = 0.00000000

Test #14:

score: 0
Accepted
time: 3ms
memory: 3576kb

input:

100000 100500

output:

1046.82420752

result:

ok OK 1046.82420752, real ans = 1046.82420753, error = 0.00000000

Test #15:

score: 0
Accepted
time: 2ms
memory: 3560kb

input:

1000000000000 1000000000000

output:

1772453.85090552

result:

ok OK 1772453.85090552, real ans = 1772453.85090552, error = 0.00000000

Test #16:

score: 0
Accepted
time: 6ms
memory: 3436kb

input:

1000000000000 999995000000

output:

918167024.49549815

result:

ok OK 918167024.49549818, real ans = 918167024.49532175, error = 0.00000000

Test #17:

score: 0
Accepted
time: 0ms
memory: 3700kb

input:

1000000000000 999994970000

output:

989900658.76059974

result:

ok OK 989900658.76059973, real ans = 989900658.76037264, error = 0.00000000

Test #18:

score: 0
Accepted
time: 2ms
memory: 3572kb

input:

1000000000000 999994969900

output:

990149653.47570508

result:

ok OK 990149653.47570503, real ans = 990149653.47589362, error = 0.00000000

Test #19:

score: 0
Accepted
time: 5ms
memory: 3496kb

input:

1000000000000 999994965966

output:

999998930.01122539

result:

ok OK 999998930.01122534, real ans = 999998930.01106715, error = 0.00000000

Test #20:

score: 0
Accepted
time: 5ms
memory: 3444kb

input:

1000000000000 999994965965

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1000001447.03807712

Test #21:

score: 0
Accepted
time: 5ms
memory: 3176kb

input:

1000000000000 999994962200

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1009526689.33672678

Test #22:

score: 0
Accepted
time: 6ms
memory: 3308kb

input:

1000000000000 999994962000

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1010035408.79225361

Test #23:

score: 0
Accepted
time: 2ms
memory: 3408kb

input:

10000000000000 10000000000000

output:

5604991.21639793

result:

ok OK 5604991.21639793, real ans = 5604991.21639793, error = 0.00000000

Test #24:

score: -100
Wrong Answer
time: 2ms
memory: 3352kb

input:

10000000000000 9999985614000

output:

Extreme Wealth

result:

wrong answer WA not Extreme Wealth, real ans = 989882007.19958651