QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#180112 | #7247. Hans Zimmer | mendicillin2# | AC ✓ | 538ms | 87412kb | Python3 | 417b | 2023-09-15 15:48:13 | 2023-09-15 15:48:13 |
Judging History
answer
from math import log
from math import exp
H, W, N = map(int, input().split())
logs = [0] * (N+2)
for i in range(1, N+2):
logs[i] = log(i)
facs = [0] * (N+1)
for i in range(1, N+1):
facs[i] = facs[i-1] + logs[i]
ans = 0
c = facs[N] + log(H) + log(W) - N * log(2)
for x in range(0, N+1):
ans += (exp(c - facs[N-x] - facs[x] - 2 * logs[x+1] - 2 * logs[N-x+1]))
print("{:.40f}".format(ans))
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 12ms
memory: 9100kb
input:
2 4 1
output:
1.9999999999999995559107901499373838305473
result:
ok jury = 2, participant = 2, relative error = 2.220446049e-16
Test #2:
score: 0
Accepted
time: 14ms
memory: 9092kb
input:
42 24 2
output:
87.4999999999999147348717087879776954650879
result:
ok jury = 87.5, participant = 87.5, relative error = 9.74458609e-16
Test #3:
score: 0
Accepted
time: 14ms
memory: 9168kb
input:
1 1 5
output:
0.0092013888888888891587347629297255480196
result:
ok jury = 0.009201388889, participant = 0.009201388889, relative error = 1.207543499e-11
Test #4:
score: 0
Accepted
time: 14ms
memory: 9192kb
input:
1 1 1
output:
0.2500000000000000555111512312578270211816
result:
ok jury = 0.25, participant = 0.25, relative error = 2.220446049e-16
Test #5:
score: 0
Accepted
time: 14ms
memory: 9112kb
input:
1 1000 1
output:
249.9999999999998863131622783839702606201172
result:
ok jury = 250, participant = 250, relative error = 4.547473509e-16
Test #6:
score: 0
Accepted
time: 11ms
memory: 9152kb
input:
1000 1 1
output:
249.9999999999998863131622783839702606201172
result:
ok jury = 250, participant = 250, relative error = 4.547473509e-16
Test #7:
score: 0
Accepted
time: 14ms
memory: 9104kb
input:
1000 1000 1
output:
249999.9999999998253770172595977783203125000000
result:
ok jury = 250000, participant = 250000, relative error = 6.98491931e-16
Test #8:
score: 0
Accepted
time: 14ms
memory: 9168kb
input:
1 1000 5
output:
9.2013888888888750727801379980519413948059
result:
ok jury = 9.201388889, participant = 9.201388889, relative error = 1.207701712e-11
Test #9:
score: 0
Accepted
time: 14ms
memory: 9140kb
input:
1000 1000 5
output:
9201.3888888888668589061126112937927246093750
result:
ok jury = 9201.388889, participant = 9201.388889, relative error = 1.207784802e-11
Test #10:
score: 0
Accepted
time: 14ms
memory: 9192kb
input:
1 1 10
output:
0.0009391233428172656100621495944835714909
result:
ok jury = 0.0009391233428, participant = 0.0009391233428, relative error = 1.838479947e-11
Test #11:
score: 0
Accepted
time: 6ms
memory: 9172kb
input:
1 1 2
output:
0.0868055555555555663493905171890219207853
result:
ok jury = 0.08680555556, participant = 0.08680555556, relative error = 5.119984436e-11
Test #12:
score: 0
Accepted
time: 14ms
memory: 9148kb
input:
1 1 3
output:
0.0364583333333333425851918718763045035303
result:
ok jury = 0.03645833333, participant = 0.03645833333, relative error = 9.142876932e-11
Test #13:
score: 0
Accepted
time: 11ms
memory: 9172kb
input:
1 1 4
output:
0.0174421296296296268746317537079448811710
result:
ok jury = 0.01744212963, participant = 0.01744212963, relative error = 2.123444088e-11
Test #14:
score: 0
Accepted
time: 10ms
memory: 9168kb
input:
1 1 100
output:
0.0000001507872879412525721369223294029971
result:
ok jury = 1.507872879e-07, participant = 1.507872879e-07, relative error = 2.735812132e-10
Test #15:
score: 0
Accepted
time: 14ms
memory: 9156kb
input:
1000 1000 100
output:
0.1507872879412438804624940758003504015505
result:
ok jury = 0.1507872879, participant = 0.1507872879, relative error = 2.735235178e-10
Test #16:
score: 0
Accepted
time: 10ms
memory: 9312kb
input:
1 1 1000
output:
0.0000000000159043986921770274279990778486
result:
ok jury = 1.590439869e-11, participant = 1.590439869e-11, relative error = 1.368820239e-10
Test #17:
score: 0
Accepted
time: 9ms
memory: 9224kb
input:
1000 1000 1000
output:
0.0000159043986921797366341363444419698681
result:
ok jury = 1.590439869e-05, participant = 1.590439869e-05, relative error = 1.370525028e-10
Test #18:
score: 0
Accepted
time: 17ms
memory: 10028kb
input:
1 1 10000
output:
0.0000000000000015990403993596673773396974
result:
ok jury = 1.5990404e-15, participant = 1.599040399e-15, relative error = 4.004480414e-10
Test #19:
score: 0
Accepted
time: 20ms
memory: 10024kb
input:
1000 1000 10000
output:
0.0000000015990403993599373767858684539816
result:
ok jury = 1.5990404e-09, participant = 1.599040399e-09, relative error = 4.002792166e-10
Test #20:
score: 0
Accepted
time: 69ms
memory: 16936kb
input:
1 1 100000
output:
0.0000000000000000001599904007748664027495
result:
ok jury = 1.599904004e-19, participant = 1.599904008e-19, relative error = 2.343055565e-09
Test #21:
score: 0
Accepted
time: 63ms
memory: 17008kb
input:
1000 1000 100000
output:
0.0000000000001599904007748925757507065328
result:
ok jury = 1.599904004e-13, participant = 1.599904008e-13, relative error = 2.343219187e-09
Test #22:
score: 0
Accepted
time: 533ms
memory: 87412kb
input:
1 1 1000000
output:
0.0000000000000000000000159998997038507895
result:
ok jury = 1.5999904e-23, participant = 1.59998997e-23, relative error = 2.685109367e-07
Test #23:
score: 0
Accepted
time: 538ms
memory: 87352kb
input:
1000 1000 1000000
output:
0.0000000000000000159998996740513674999515
result:
ok jury = 1.5999904e-17, participant = 1.599989967e-17, relative error = 2.703734117e-07
Test #24:
score: 0
Accepted
time: 73ms
memory: 18808kb
input:
1 1 123456
output:
0.0000000000000000000688731696672557697003
result:
ok jury = 6.887316951e-20, participant = 6.887316967e-20, relative error = 2.283266006e-09
Test #25:
score: 0
Accepted
time: 75ms
memory: 18780kb
input:
1000 1000 123456
output:
0.0000000000000688731696672671016032799069
result:
ok jury = 6.887316951e-14, participant = 6.887316967e-14, relative error = 2.283430489e-09
Test #26:
score: 0
Accepted
time: 217ms
memory: 42168kb
input:
1 1 424243
output:
0.0000000000000000000004939182524401105273
result:
ok jury = 4.939182799e-22, participant = 4.939182524e-22, relative error = 5.559601782e-08
Test #27:
score: 0
Accepted
time: 250ms
memory: 42308kb
input:
1000 1000 424243
output:
0.0000000000000004939182524401919841770890
result:
ok jury = 4.939182799e-16, participant = 4.939182524e-16, relative error = 5.559585288e-08
Test #28:
score: 0
Accepted
time: 15ms
memory: 9164kb
input:
1 1 20
output:
0.0000753731487305571787186156407223336373
result:
ok jury = 7.537314873e-05, participant = 7.537314873e-05, relative error = 7.392354683e-12
Test #29:
score: 0
Accepted
time: 12ms
memory: 9176kb
input:
1 1 30
output:
0.0000162971064032072493054249112676146183
result:
ok jury = 1.62971064e-05, participant = 1.62971064e-05, relative error = 1.967987149e-10
Test #30:
score: 0
Accepted
time: 10ms
memory: 9196kb
input:
1 1 50
output:
0.0000022768228277982365040366368597046787
result:
ok jury = 2.276822828e-06, participant = 2.276822828e-06, relative error = 8.861632494e-11
Test #31:
score: 0
Accepted
time: 15ms
memory: 9108kb
input:
1 1 200
output:
0.0000000097061491119675967328614667878339
result:
ok jury = 9.706149112e-09, participant = 9.706149112e-09, relative error = 3.338499434e-12
Test #32:
score: 0
Accepted
time: 15ms
memory: 9100kb
input:
1 1 300
output:
0.0000000019363452300404502563725934809972
result:
ok jury = 1.93634523e-09, participant = 1.93634523e-09, relative error = 2.089006242e-11
Test #33:
score: 0
Accepted
time: 15ms
memory: 9132kb
input:
1 1 500
output:
0.0000000002529534331286532107368632498032
result:
ok jury = 2.529534331e-10, participant = 2.529534331e-10, relative error = 1.132747078e-10
Test #34:
score: 0
Accepted
time: 13ms
memory: 9144kb
input:
1 1 700
output:
0.0000000000660710939676920402447813365497
result:
ok jury = 6.607109397e-11, participant = 6.607109397e-11, relative error = 3.493151115e-11
Test #35:
score: 0
Accepted
time: 10ms
memory: 9312kb
input:
1 1 2000
output:
0.0000000000009970062397550874717467240615
result:
ok jury = 9.970062398e-13, participant = 9.970062398e-13, relative error = 4.504737557e-11
Test #36:
score: 0
Accepted
time: 17ms
memory: 9376kb
input:
1 1 3000
output:
0.0000000000001971363505733045183707643462
result:
ok jury = 1.971363506e-13, participant = 1.971363506e-13, relative error = 1.354163354e-10
Test #37:
score: 0
Accepted
time: 15ms
memory: 9676kb
input:
1 1 5000
output:
0.0000000000000255693055849950709522405183
result:
ok jury = 2.556930558e-14, participant = 2.556930558e-14, relative error = 1.953541675e-10
Test #38:
score: 0
Accepted
time: 19ms
memory: 9820kb
input:
1 1 7000
output:
0.0000000000000066581815387015990150327982
result:
ok jury = 6.658181538e-15, participant = 6.658181539e-15, relative error = 1.053739201e-10
Test #39:
score: 0
Accepted
time: 27ms
memory: 10700kb
input:
1 1 20000
output:
0.0000000000000000999700061976399976207095
result:
ok jury = 9.997000625e-17, participant = 9.99700062e-17, relative error = 5.237571107e-10
Test #40:
score: 0
Accepted
time: 28ms
memory: 11456kb
input:
1 1 30000
output:
0.0000000000000000197491363710227586970453
result:
ok jury = 1.974913635e-17, participant = 1.974913637e-17, relative error = 1.064489988e-09
Test #41:
score: 0
Accepted
time: 41ms
memory: 12996kb
input:
1 1 50000
output:
0.0000000000000000025596928188312802279954
result:
ok jury = 2.559692826e-18, participant = 2.559692819e-18, relative error = 2.80061727e-09
Test #42:
score: 0
Accepted
time: 59ms
memory: 14660kb
input:
1 1 70000
output:
0.0000000000000000006663318865864069779815
result:
ok jury = 6.663318889e-19, participant = 6.663318866e-19, relative error = 3.472133186e-09
Test #43:
score: 0
Accepted
time: 118ms
memory: 24624kb
input:
1 1 200000
output:
0.0000000000000000000099997000503335793091
result:
ok jury = 9.999700006e-21, participant = 9.99970005e-21, relative error = 4.433490855e-09
Test #44:
score: 0
Accepted
time: 173ms
memory: 32528kb
input:
1 1 300000
output:
0.0000000000000000000019752690311299146120
result:
ok jury = 1.975269136e-21, participant = 1.975269031e-21, relative error = 5.309154258e-08
Test #45:
score: 0
Accepted
time: 275ms
memory: 48328kb
input:
1 1 500000
output:
0.0000000000000000000002559969267959235231
result:
ok jury = 2.55996928e-22, participant = 2.559969268e-22, relative error = 4.703480254e-09
Extra Test:
score: 0
Extra Test Passed