QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#178124#7247. Hans ZimmerPhantomThreshold#WA 1ms3796kbC++20925b2023-09-13 18:15:222023-09-13 18:15:22

Judging History

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

  • [2023-09-13 18:15:22]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3796kb
  • [2023-09-13 18:15:22]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double db;

int main(){
	ios_base::sync_with_stdio(false);
	ll w,h,n;
	cin >> w >> h >> n;
	
	db ans=0;
	if (n%2==1){
		ll k=n/2;
		db C=1;
		int cnt=n;
		for (int i=k;i>=1;i--){
			C=C*(i+k+1)/i;
			for (;cnt>0 && C>1;cnt--) C=C/2;
		}
		for (;cnt>0;cnt--) C=C/2;
		/*
		cerr << k << endl;
		cerr << C << endl;
		*/
		for (int i=k;i>=0;i--){
			ans=ans+2*C/(i+1)/(i+1)/(n-i+1)/(n-i+1);
			C=C*i/(n-i+1);
		}
	}
	else{
		ll k=n/2;
		db C=1;
		int cnt=n;
		for (int i=k;i>=1;i--){
			C=C*(i+k)/i;
			for (;cnt>0 && C>1;cnt--) C=C/2;
		}
		for (;cnt>0;cnt--) C=C/2;
		ans=ans+C/(k+1)/(k+1)/(k+1)/(k+1);
		for (int i=k;i>=0;i--){
			if (i!=k){
				ans=ans+2*C/(i+1)/(i+1)/(n-i+1)/(n-i+1);
			}
			C=C*i/(n-i+1);
		}
	}
	ans=ans*w*h;
	cout << fixed << setprecision(12) << ans << "\n";
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 4 1

output:

2.000000000000

result:

ok jury = 2, participant = 2, relative error = 0

Test #2:

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

input:

42 24 2

output:

87.500000000000

result:

ok jury = 87.5, participant = 87.5, relative error = 0

Test #3:

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

input:

1 1 5

output:

0.009201388889

result:

ok jury = 0.009201388889, participant = 0.009201388889, relative error = 0

Test #4:

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

input:

1 1 1

output:

0.250000000000

result:

ok jury = 0.25, participant = 0.25, relative error = 0

Test #5:

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

input:

1 1000 1

output:

250.000000000000

result:

ok jury = 250, participant = 250, relative error = 0

Test #6:

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

input:

1000 1 1

output:

250.000000000000

result:

ok jury = 250, participant = 250, relative error = 0

Test #7:

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

input:

1000 1000 1

output:

250000.000000000000

result:

ok jury = 250000, participant = 250000, relative error = 0

Test #8:

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

input:

1 1000 5

output:

9.201388888889

result:

ok jury = 9.201388889, participant = 9.201388889, relative error = 1.20635034e-11

Test #9:

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

input:

1000 1000 5

output:

9201.388888888889

result:

ok jury = 9201.388889, participant = 9201.388889, relative error = 1.207547579e-11

Test #10:

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

input:

1 1 10

output:

0.000939123343

result:

ok jury = 0.0009391233428, participant = 0.000939123343, relative error = 2.129645241e-10

Test #11:

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

input:

1 1 2

output:

0.086805555556

result:

ok jury = 0.08680555556, participant = 0.08680555556, relative error = 4.607993986e-11

Test #12:

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

input:

1 1 3

output:

0.036458333333

result:

ok jury = 0.03645833333, participant = 0.03645833333, relative error = 8.22856069e-11

Test #13:

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

input:

1 1 4

output:

0.017442129630

result:

ok jury = 0.01744212963, participant = 0.01744212963, relative error = 0

Test #14:

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

input:

1 1 100

output:

0.000000150787

result:

ok jury = 1.507872879e-07, participant = 1.50787e-07, relative error = 1.909312144e-06

Test #15:

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

input:

1000 1000 100

output:

0.150787287941

result:

ok jury = 0.1507872879, participant = 0.1507872879, relative error = 2.719060854e-10

Test #16:

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

input:

1 1 1000

output:

0.000000000016

result:

wrong answer jury = 1.590439869e-11, participant = 1.6e-11, relative error = 0.005975081875