QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#801938#968. Extreme WealthpeimudaAC ✓44ms4024kbC++11728b2024-12-07 10:51:312024-12-07 10:51:31

Judging History

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

  • [2024-12-07 10:51:31]
  • 评测
  • 测评结果:AC
  • 用时:44ms
  • 内存:4024kb
  • [2024-12-07 10:51:31]
  • 提交

answer

#include<set>
#include<map>
#include<queue>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#define pr pair
#define f first
#define s second
#define ll long long
#define ld long double
#define mp make_pair
#define pll pr<ll,ll>
#define pii pr<int,int>
#define piii pr<int,pii>
using namespace std;
const ld pi=acosl(0.5)*3;
ld cnt(ll x)
{
	if(x%2==1) return cnt(x+1);
	if(x>10000000) return sqrtl(pi*x/2);
	ld fd=x;
	for(int i=1;i<=x/2;i++) fd-=log2l(i+x/2)-log2l(i);
	return powl(2,fd);
}
int main()
{
	ll a,b;
	cin>>a>>b;
	if(a>b) swap(a,b);
	b+=a;
	ld gt=cnt(b);
	ll c=b/2;
	while(gt<9.99e8&&c>a)
	{
		gt=gt*(b-c+1)/c;
		c--;
	}
	if(gt>=9.98e8) cout<<"Extreme Wealth\n";
	else printf("%.10Lf\n",gt);
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 4012kb

input:

3 2

output:

3.2000000000

result:

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

Test #2:

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

input:

0 29

output:

536870912.0000000007

result:

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

Test #3:

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

input:

30 0

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1073741824.00000000

Test #4:

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

input:

37 73

output:

5028.4888595832

result:

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

Test #5:

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

input:

10000000000 10000000000

output:

177245.3850905516

result:

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

Test #6:

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

input:

10000000000 9999412550

output:

989753719.1324365872

result:

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

Test #7:

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

input:

10000000000 9999412400

output:

994124819.3433177105

result:

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

Test #8:

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

input:

10000000000 9999412200

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 999984746.74201429

Test #9:

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

input:

10000000000 9999412199

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1000014138.02130949

Test #10:

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

input:

10000000000 9999411862

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1009971237.25187039

Test #11:

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

input:

10000000000 9999411861

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1010000939.12199187

Test #12:

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

input:

1000000000 100000000

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 2000288524.07298231

Test #13:

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

input:

999900000 999999999

output:

682861.8615204583

result:

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

Test #14:

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

input:

100000 100500

output:

1046.8242075262

result:

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

Test #15:

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

input:

1000000000000 1000000000000

output:

1772453.8509055160

result:

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

Test #16:

score: 0
Accepted
time: 16ms
memory: 3896kb

input:

1000000000000 999995000000

output:

918167024.4954982096

result:

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

Test #17:

score: 0
Accepted
time: 16ms
memory: 3956kb

input:

1000000000000 999994970000

output:

989900658.7605997497

result:

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

Test #18:

score: 0
Accepted
time: 16ms
memory: 3760kb

input:

1000000000000 999994969900

output:

990149653.4757050485

result:

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

Test #19:

score: 0
Accepted
time: 16ms
memory: 3508kb

input:

1000000000000 999994965966

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 999998930.01106715

Test #20:

score: 0
Accepted
time: 9ms
memory: 3752kb

input:

1000000000000 999994965965

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1000001447.03807712

Test #21:

score: 0
Accepted
time: 16ms
memory: 3696kb

input:

1000000000000 999994962200

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1009526689.33672678

Test #22:

score: 0
Accepted
time: 16ms
memory: 3756kb

input:

1000000000000 999994962000

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1010035408.79225361

Test #23:

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

input:

10000000000000 10000000000000

output:

5604991.2163979287

result:

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

Test #24:

score: 0
Accepted
time: 44ms
memory: 3856kb

input:

10000000000000 9999985614000

output:

989882007.1995265621

result:

ok OK 989882007.19952655, real ans = 989882007.19958651, error = 0.00000000

Test #25:

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

input:

10000000000000 9999985613835

output:

989999498.6191406752

result:

ok OK 989999498.61914062, real ans = 989999498.61902094, error = 0.00000000

Test #26:

score: 0
Accepted
time: 44ms
memory: 3792kb

input:

10000000000000 9999985613834

output:

990000210.7349718293

result:

ok OK 990000210.73497188, real ans = 990000210.73484683, error = 0.00000000

Test #27:

score: 0
Accepted
time: 40ms
memory: 3704kb

input:

10000000000000 9999985599900

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 999977583.49870884

Test #28:

score: 0
Accepted
time: 44ms
memory: 3552kb

input:

10000000000000 9999985586056

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1009999801.48704243

Test #29:

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

input:

10000000000000 9999985586055

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1010000529.39213884

Test #30:

score: 0
Accepted
time: 44ms
memory: 3756kb

input:

10000000000000 9999985486055

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1085749634.67051625

Test #31:

score: 0
Accepted
time: 40ms
memory: 3628kb

input:

10000000000000 9999905586055

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 2000000758.78793645

Test #32:

score: 0
Accepted
time: 34ms
memory: 3508kb

input:

10000000000000 1000000000000

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 2000003461.21803880

Test #33:

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

input:

0 0

output:

1.0000000000

result:

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

Test #34:

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

input:

0 1

output:

2.0000000000

result:

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

Test #35:

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

input:

1 1

output:

2.0000000000

result:

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

Test #36:

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

input:

0 2

output:

4.0000000000

result:

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

Test #37:

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

input:

1 2

output:

2.6666666667

result:

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

Test #38:

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

input:

2 2

output:

2.6666666667

result:

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

Test #39:

score: 0
Accepted
time: 32ms
memory: 3512kb

input:

10000000000000 0

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 2147483648.00000000

Test #40:

score: 0
Accepted
time: 32ms
memory: 3636kb

input:

10000000000000 1

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 3714566310.05405521

Test #41:

score: 0
Accepted
time: 32ms
memory: 3600kb

input:

2 10000000000000

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 2681735677.50243759