結果

問題 No.567 コンプリート
ユーザー tktk_snsntktk_snsn
提出日時 2021-01-11 16:31:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 407 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 82,236 KB
実行使用メモリ 62,000 KB
最終ジャッジ日時 2024-05-01 06:50:57
合計ジャッジ時間 1,607 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
61,192 KB
testcase_01 AC 42 ms
59,352 KB
testcase_02 AC 43 ms
60,892 KB
testcase_03 AC 44 ms
61,388 KB
testcase_04 AC 45 ms
61,496 KB
testcase_05 AC 44 ms
62,000 KB
testcase_06 AC 44 ms
61,096 KB
testcase_07 AC 43 ms
59,852 KB
testcase_08 AC 44 ms
61,016 KB
testcase_09 AC 43 ms
61,872 KB
testcase_10 AC 44 ms
61,172 KB
testcase_11 AC 36 ms
52,132 KB
testcase_12 AC 44 ms
60,936 KB
testcase_13 AC 43 ms
60,612 KB
testcase_14 AC 45 ms
60,824 KB
testcase_15 AC 37 ms
52,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
if n > 100000:
    print(0.999999999)
    exit()

dp = [0.0] * (1 << 6)
dp[0] = 1.0
for _ in range(n):
    newDP = [0.0] * (1 << 6)
    for S in reversed(range(1 << 6)):
        for i in range(6):
            if (S >> i) & 1:
                newDP[S] += dp[S] / 6.0
            else:
                newDP[S ^ (1 << i)] += dp[S] / 6.0
    dp = newDP

print("{:.15f}".format(dp[(1 << 6)-1]))
0