結果

問題 No.567 コンプリート
ユーザー brthyyjpbrthyyjp
提出日時 2022-02-24 11:27:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 655 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 1,305 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 77,156 KB
最終ジャッジ日時 2023-09-15 05:57:54
合計ジャッジ時間 4,476 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,388 KB
testcase_01 AC 73 ms
71,284 KB
testcase_02 AC 75 ms
71,352 KB
testcase_03 AC 73 ms
71,228 KB
testcase_04 AC 73 ms
71,464 KB
testcase_05 AC 72 ms
71,328 KB
testcase_06 AC 73 ms
71,608 KB
testcase_07 AC 77 ms
71,212 KB
testcase_08 AC 74 ms
71,384 KB
testcase_09 AC 74 ms
71,444 KB
testcase_10 AC 73 ms
71,388 KB
testcase_11 AC 73 ms
71,372 KB
testcase_12 AC 76 ms
71,268 KB
testcase_13 AC 76 ms
71,292 KB
testcase_14 AC 76 ms
71,536 KB
testcase_15 AC 655 ms
77,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
dp = [0]*6
dp[0] = 1
for i in range(n-1):
    nx = [0]*6
    for j in range(1, 7):
        if j != 6:
            nx[j-1] += dp[j-1]*j/6
            nx[j] += dp[j-1]*(6-j)/6
        else:
            nx[j-1] += dp[j-1]
    dp = nx
print(dp[5])
0