QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#466626#968. Extreme WealthKevin5307WA 37ms4000kbC++231.3kb2024-07-07 23:24:412024-07-07 23:24:41

Judging History

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

  • [2024-07-07 23:24:41]
  • 评测
  • 测评结果:WA
  • 用时:37ms
  • 内存:4000kb
  • [2024-07-07 23:24:41]
  • 提交

answer

//Author: Kevin
#include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define ull unsigned ll
#define pb emplace_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (int)(x.size())
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define lb(v,x) (int)(lower_bound(ALL(v),x)-v.begin())
#define ub(v,x) (int)(upper_bound(ALL(v),x)-v.begin())
#define uni(v) v.resize(unique(ALL(v))-v.begin())
#define longer __int128_t
void die(string S){puts(S.c_str());exit(0);}
const long double pi=acos(-1.0);
long double get(ll x)
{
	long double val=lgammal(x+1);
	long double val2=lgammal(x+x+1);
	long double log_2=logl(2);
	long double Log=log_2*(x+x)+val+val-val2;
	return expl(Log);
}
long double get2(ll x)
{
	if(x<=10000)
	{
		long double ret=1;
		for(int i=1;i<=x;i++)
			ret=ret/(i+x)*i*4;
		return ret;
	}
	return sqrtl(pi*x)/(1.0-1.0/8/x);
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll a,b;
	cin>>a>>b;
	if(a<b) swap(a,b);
	long double val=get(a);
	for(ll i=a;i>b;i--)
	{
		val=val/2/i*(i+a);
		if(val>1e9) die("Extreme Wealth");
	}
	cout<<fixed<<setprecision(15)<<val<<endl;
	return 0;
}

詳細信息

Test #1:

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

input:

3 2

output:

3.200000000000000

result:

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

Test #2:

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

input:

0 29

output:

536870912.000000010302756

result:

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

Test #3:

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

input:

30 0

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1073741824.00000000

Test #4:

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

input:

37 73

output:

5028.488859583218624

result:

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

Test #5:

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

input:

10000000000 10000000000

output:

177245.378794218716038

result:

ok OK 177245.37879422, real ans = 177245.38509055, error = 0.00000004

Test #6:

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

input:

10000000000 9999412550

output:

989753683.973163887159899

result:

ok OK 989753683.97316384, real ans = 989753719.13242424, error = 0.00000004

Test #7:

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

input:

10000000000 9999412400

output:

994124784.028769298631232

result:

ok OK 994124784.02876925, real ans = 994124819.34340525, error = 0.00000004

Test #8:

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

input:

10000000000 9999412200

output:

999984711.219323765428271

result:

ok OK 999984711.21932375, real ans = 999984746.74201429, error = 0.00000004

Test #9:

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

input:

10000000000 9999412199

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1000014138.02130949

Test #10:

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

input:

10000000000 9999411862

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1009971237.25187039

Test #11:

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

input:

10000000000 9999411861

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1010000939.12199187

Test #12:

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

input:

1000000000 100000000

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 2000288524.07298231

Test #13:

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

input:

999900000 999999999

output:

682861.862301035738540

result:

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

Test #14:

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

input:

100000 100500

output:

1046.824207526788559

result:

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

Test #15:

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

input:

1000000000000 1000000000000

output:

1772452.259920653610493

result:

ok OK 1772452.25992065, real ans = 1772453.85090552, error = 0.00000090

Test #16:

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

input:

1000000000000 999995000000

output:

918166200.333088362822309

result:

ok OK 918166200.33308840, real ans = 918167024.49532175, error = 0.00000090

Test #17:

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

input:

1000000000000 999994970000

output:

989899770.208854047697969

result:

ok OK 989899770.20885408, real ans = 989900658.76037264, error = 0.00000090

Test #18:

score: 0
Accepted
time: 37ms
memory: 3848kb

input:

1000000000000 999994969900

output:

990148764.700457563798409

result:

ok OK 990148764.70045757, real ans = 990149653.47589362, error = 0.00000090

Test #19:

score: 0
Accepted
time: 37ms
memory: 3868kb

input:

1000000000000 999994965966

output:

999998032.395098971086554

result:

ok OK 999998032.39509892, real ans = 999998930.01106715, error = 0.00000090

Test #20:

score: 0
Accepted
time: 37ms
memory: 3740kb

input:

1000000000000 999994965965

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1000001447.03807712

Test #21:

score: 0
Accepted
time: 33ms
memory: 3580kb

input:

1000000000000 999994962200

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1009526689.33672678

Test #22:

score: 0
Accepted
time: 37ms
memory: 3624kb

input:

1000000000000 999994962000

output:

Extreme Wealth

result:

ok OK Extreme Wealth, real ans = 1010035408.79225361

Test #23:

score: -100
Wrong Answer
time: 0ms
memory: 3916kb

input:

10000000000000 10000000000000

output:

5605083.828020952430052

result:

wrong answer WA 5605083.82802095, real ans = 5604991.21639793, error = 0.00001652