QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#178166#7247. Hans ZimmerPhantomThreshold#AC ✓90ms3804kbC++20926b2023-09-13 18:49:562023-09-13 18:49:57

Judging History

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

  • [2023-09-13 18:49:57]
  • 评测
  • 测评结果:AC
  • 用时:90ms
  • 内存:3804kb
  • [2023-09-13 18:49:56]
  • 提交

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(100) << ans << "\n";
	return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3692kb

input:

2 4 1

output:

2.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

result:

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

Test #2:

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

input:

42 24 2

output:

87.5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

result:

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

Test #3:

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

input:

1 1 5

output:

0.0092013888888888888893782857028580401959061418892815709114074707031250000000000000000000000000000000

result:

ok jury = 0.009201388889, participant = 0.009201388889, relative error = 1.207543499e-11

Test #4:

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

input:

1 1 1

output:

0.2500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

result:

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

Test #5:

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

input:

1 1000 1

output:

250.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

result:

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

Test #6:

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

input:

1000 1 1

output:

250.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

result:

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

Test #7:

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

input:

1000 1000 1

output:

250000.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

result:

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

Test #8:

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

input:

1 1000 5

output:

9.2013888888888888889852624153320448385784402489662170410156250000000000000000000000000000000000000000

result:

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

Test #9:

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

input:

1000 1000 5

output:

9201.3888888888888892836348532000556588172912597656250000000000000000000000000000000000000000000000000000

result:

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

Test #10:

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

input:

1 1 10

output:

0.0009391233428172644555033029276688155695396176270151045173406600952148437500000000000000000000000000

result:

ok jury = 0.0009391233428, participant = 0.0009391233428, relative error = 1.838352954e-11

Test #11:

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

input:

1 1 2

output:

0.0868055555555555555548026373802183996986059355549514293670654296875000000000000000000000000000000000

result:

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

Test #12:

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

input:

1 1 3

output:

0.0364583333333333333355920878593448009041821933351457118988037109375000000000000000000000000000000000

result:

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

Test #13:

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

input:

1 1 4

output:

0.0174421296296296296291828981789295838211728550959378480911254882812500000000000000000000000000000000

result:

ok jury = 0.01744212963, participant = 0.01744212963, relative error = 2.123424197e-11

Test #14:

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

input:

1 1 100

output:

0.0000001507872879412450093926028189957994866000207112577413681719917804002761840820312500000000000000

result:

ok jury = 1.507872879e-07, participant = 1.507872879e-07, relative error = 2.735310077e-10

Test #15:

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

input:

1000 1000 100

output:

0.1507872879412450093880061763318423118107602931559085845947265625000000000000000000000000000000000000

result:

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

Test #16:

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

input:

1 1 1000

output:

0.0000000000159043986921659615349229617343444609008722801868698781824207344470778480172157287597656250

result:

ok jury = 1.590439869e-11, participant = 1.590439869e-11, relative error = 1.36186193e-10

Test #17:

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

input:

1000 1000 1000

output:

0.0000159043986921659615341841335431761865482069850941115873865783214569091796875000000000000000000000

result:

ok jury = 1.590439869e-05, participant = 1.590439869e-05, relative error = 1.361863183e-10

Test #18:

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

input:

1 1 10000

output:

0.0000000000000015990403998688417471861141408644821122610934772864440937302499268213296090834774076939

result:

ok jury = 1.5990404e-15, participant = 1.5990404e-15, relative error = 8.2023058e-11

Test #19:

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

input:

1000 1000 10000

output:

0.0000000015990403998688417471572097842591184765784293603241295045336300972849130630493164062500000000

result:

ok jury = 1.5990404e-09, participant = 1.5990404e-09, relative error = 8.202305052e-11

Test #20:

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

input:

1 1 100000

output:

0.0000000000000000001599904003999868796690628653945939822532172946146181988002148805991242674906516186

result:

ok jury = 1.599904004e-19, participant = 1.599904004e-19, relative error = 8.200740615e-14

Test #21:

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

input:

1000 1000 100000

output:

0.0000000000001599904003999868796651207275396763588664933397633896756950822037879333947785198688507080

result:

ok jury = 1.599904004e-13, participant = 1.599904004e-13, relative error = 8.204645673e-14

Test #22:

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

input:

1 1 1000000

output:

0.0000000000000000000000159999040003999993515839033422613382333671294494186769823458934498074834234041

result:

ok jury = 1.5999904e-23, participant = 1.5999904e-23, relative error = 2.500015978e-11

Test #23:

score: 0
Accepted
time: 90ms
memory: 3728kb

input:

1000 1000 1000000

output:

0.0000000000000000159999040003999993508629946974211072226206777449503466252461649638183516231038083788

result:

ok jury = 1.5999904e-17, participant = 1.5999904e-17, relative error = 2.500026142e-11

Test #24:

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

input:

1 1 123456

output:

0.0000000000000000000688731695147357381112329976164508670584246770503267938787324232898651166223658038

result:

ok jury = 6.887316951e-20, participant = 6.887316951e-20, relative error = 6.876032272e-11

Test #25:

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

input:

1000 1000 123456

output:

0.0000000000000688731695147357381111923725316864488021492775156003930681070102082230732776224613189697

result:

ok jury = 6.887316951e-14, participant = 6.887316951e-14, relative error = 6.876012364e-11

Test #26:

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

input:

1 1 424243

output:

0.0000000000000000000004939182799384576779413655023671512472442026649590196107175017424992225466284790

result:

ok jury = 4.939182799e-22, participant = 4.939182799e-22, relative error = 7.786239713e-11

Test #27:

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

input:

1000 1000 424243

output:

0.0000000000000004939182799384576779628829264589532200775703872728728178499724155159356087096966803074

result:

ok jury = 4.939182799e-16, participant = 4.939182799e-16, relative error = 7.786239332e-11

Test #28:

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

input:

1 1 20

output:

0.0000753731487305575033439926759329385852481664187507703900337219238281250000000000000000000000000000

result:

ok jury = 7.537314873e-05, participant = 7.537314873e-05, relative error = 7.396670021e-12

Test #29:

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

input:

1 1 30

output:

0.0000162971064032071392970208866153580817837109862011857330799102783203125000000000000000000000000000

result:

ok jury = 1.62971064e-05, participant = 1.62971064e-05, relative error = 1.967920622e-10

Test #30:

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

input:

1 1 50

output:

0.0000022768228277982377036553202147330641526290495590956197702325880527496337890625000000000000000000

result:

ok jury = 2.276822828e-06, participant = 2.276822828e-06, relative error = 8.86157669e-11

Test #31:

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

input:

1 1 200

output:

0.0000000097061491119702695472910816873672969814362820883957283513154834508895874023437500000000000000

result:

ok jury = 9.706149112e-09, participant = 9.706149112e-09, relative error = 3.063060873e-12

Test #32:

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

input:

1 1 300

output:

0.0000000019363452300390618173566034933820099126226734614908409071176720317453145980834960937500000000

result:

ok jury = 1.93634523e-09, participant = 1.93634523e-09, relative error = 2.017302982e-11

Test #33:

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

input:

1 1 500

output:

0.0000000002529534331279376220345531009192748078325018497997112021380416990723460912704467773437500000

result:

ok jury = 2.529534331e-10, participant = 2.529534331e-10, relative error = 1.104458752e-10

Test #34:

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

input:

1 1 700

output:

0.0000000000660710939677134527759591808474976299521568587173880882090770683134905993938446044921875000

result:

ok jury = 6.607109397e-11, participant = 6.607109397e-11, relative error = 3.460737208e-11

Test #35:

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

input:

1 1 2000

output:

0.0000000000009970062397662928514053165812893490777531509393913702887779493266862118616700172424316406

result:

ok jury = 9.970062398e-13, participant = 9.970062398e-13, relative error = 3.380842037e-11

Test #36:

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

input:

1 1 3000

output:

0.0000000000001971363505667082220423481949354885856047982944407037653178349501104094088077545166015625

result:

ok jury = 1.971363506e-13, participant = 1.971363506e-13, relative error = 1.688768859e-10

Test #37:

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

input:

1 1 5000

output:

0.0000000000000255693055832170854149103095919071107902131360004564656143721812497915379935875535011292

result:

ok jury = 2.556930558e-14, participant = 2.556930558e-14, relative error = 1.258182473e-10

Test #38:

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

input:

1 1 7000

output:

0.0000000000000066581815384121974967952559736161320345730528996924991623138079255284083046717569231987

result:

ok jury = 6.658181538e-15, participant = 6.658181538e-15, relative error = 6.190837176e-11

Test #39:

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

input:

1 1 20000

output:

0.0000000000000000999700062489751630072210549235016858584868038553588442664222732392254044953006086871

result:

ok jury = 9.997000625e-17, participant = 9.997000625e-17, relative error = 1.02514873e-11

Test #40:

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

input:

1 1 30000

output:

0.0000000000000000197491363511059962394753278790932331582494052470966489865543923298840667257536551915

result:

ok jury = 1.974913635e-17, participant = 1.974913635e-17, relative error = 5.600221171e-11

Test #41:

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

input:

1 1 50000

output:

0.0000000000000000025596928255983207267086499461930903288828835336492000216646806702580629888643670711

result:

ok jury = 2.559692826e-18, participant = 2.559692826e-18, relative error = 1.569247933e-10

Test #42:

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

input:

1 1 70000

output:

0.0000000000000000006663318889236734493670006155322499570789834771345939688288751703501566758802709955

result:

ok jury = 6.663318889e-19, participant = 6.663318889e-19, relative error = 3.552799284e-11

Test #43:

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

input:

1 1 200000

output:

0.0000000000000000000099997000062498974804340050804455685861159175102347323269164919374500481719092448

result:

ok jury = 9.999700006e-21, participant = 9.999700006e-21, relative error = 2.499044304e-11

Test #44:

score: 0
Accepted
time: 11ms
memory: 3728kb

input:

1 1 300000

output:

0.0000000000000000000019752691363511600104621222454681727866904872257146671292058004061744725179949889

result:

ok jury = 1.975269136e-21, participant = 1.975269136e-21, relative error = 1.777782282e-10

Test #45:

score: 0
Accepted
time: 31ms
memory: 3672kb

input:

1 1 500000

output:

0.0000000000000000000002559969280255998319420627576411569770005314061701871424434621219144600457948147

result:

ok jury = 2.55996928e-22, participant = 2.55996928e-22, relative error = 1.000005044e-10

Extra Test:

score: 0
Extra Test Passed