結果

問題 No.567 コンプリート
ユーザー ああいいああいい
提出日時 2022-01-28 11:50:28
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 577 bytes
コンパイル時間 1,212 ms
コンパイル使用メモリ 86,768 KB
実行使用メモリ 81,676 KB
最終ジャッジ日時 2023-08-27 22:57:55
合計ジャッジ時間 5,476 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
80,364 KB
testcase_01 AC 76 ms
76,076 KB
testcase_02 AC 81 ms
76,736 KB
testcase_03 AC 83 ms
76,384 KB
testcase_04 AC 81 ms
76,512 KB
testcase_05 AC 82 ms
76,380 KB
testcase_06 AC 82 ms
76,576 KB
testcase_07 AC 76 ms
75,928 KB
testcase_08 AC 81 ms
76,728 KB
testcase_09 AC 79 ms
76,788 KB
testcase_10 AC 81 ms
76,724 KB
testcase_11 AC 73 ms
71,236 KB
testcase_12 AC 78 ms
76,004 KB
testcase_13 AC 77 ms
75,936 KB
testcase_14 AC 83 ms
76,672 KB
testcase_15 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
"""
dp = [[0] * (1 << 6) for _ in range(n)]
p = 1 / 6
for i in range(6):
    dp[0][1 << i] = p
for i in range(n-1):
    for bit in range(1 << 6):
        for j in range(6):
            mask = 1 << j
            dp[i+1][bit | mask] += dp[i][bit] * p
print(dp[-1][(1 << 6) - 1])
"""
dp = [0] * (1 << 6)
p = 1 / 6
for i in range(6):
    dp[1 << i] = p
for _ in range(n-1):
    next = [0] * (1 << 6)
    for bit in range(1 << 6):
        for j in range(6):
            mask = 1 << j
            next[bit | mask] += dp[bit] * p
    dp = next
print(dp[(1 << 6) - 1])
0