Submission #19558882


Source Code Expand

Copy
A, B, C = map(int, input().split(' '))
dp = [[[0] * 101 for i in range(101)] for j in range(101)]
dp[A][B][C] = 1
rst = 0
for i in range(A, 101):
    for j in range(B, 101):
        for k in range(C, 101):
            if i == 100 or j == 100 or k == 100:
                rst += dp[i][j][k] * ((i + j + k) - (A + B + C))
                continue
            dp[i + 1][j][k] += dp[i][j][k] * (i / (i + j + k))
            dp[i][j + 1][k] += dp[i][j][k] * (j / (i + j + k))
            dp[i][j][k + 1] += dp[i][j][k] * (k / (i + j + k))
print(rst)

Submission Info

Submission Time
Task D - increment of coins
User Upauper63
Language Python (3.8.2)
Score 400
Code Size 557 Byte
Status AC
Exec Time 1137 ms
Memory 49848 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 4
AC × 24
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
Case Name Status Exec Time Memory
hand_01.txt AC 1137 ms 46816 KB
hand_02.txt AC 473 ms 30892 KB
hand_03.txt AC 1090 ms 49296 KB
hand_04.txt AC 49 ms 17608 KB
hand_05.txt AC 63 ms 18084 KB
random_01.txt AC 212 ms 22712 KB
random_02.txt AC 88 ms 18648 KB
random_03.txt AC 64 ms 18092 KB
random_04.txt AC 257 ms 24072 KB
random_05.txt AC 76 ms 18308 KB
random_06.txt AC 378 ms 27548 KB
random_07.txt AC 280 ms 24428 KB
random_08.txt AC 534 ms 32800 KB
random_09.txt AC 191 ms 21872 KB
random_10.txt AC 146 ms 20624 KB
random_11.txt AC 70 ms 18196 KB
random_12.txt AC 101 ms 19332 KB
random_13.txt AC 174 ms 20928 KB
random_14.txt AC 135 ms 20236 KB
random_15.txt AC 178 ms 21744 KB
sample_01.txt AC 48 ms 17500 KB
sample_02.txt AC 47 ms 17560 KB
sample_03.txt AC 1122 ms 49848 KB
sample_04.txt AC 233 ms 23016 KB