結果

問題 No.65 回数の期待値の練習
ユーザー syunsukesyunsuke
提出日時 2020-09-19 13:51:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 5,000 ms
コード長 333 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 76,808 KB
最終ジャッジ日時 2023-09-05 18:01:18
合計ジャッジ時間 2,896 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,924 KB
testcase_01 AC 76 ms
71,884 KB
testcase_02 AC 72 ms
71,692 KB
testcase_03 AC 73 ms
71,992 KB
testcase_04 AC 75 ms
71,836 KB
testcase_05 AC 75 ms
71,716 KB
testcase_06 AC 71 ms
71,752 KB
testcase_07 AC 74 ms
71,732 KB
testcase_08 AC 74 ms
76,080 KB
testcase_09 AC 74 ms
76,064 KB
testcase_10 AC 73 ms
76,012 KB
testcase_11 AC 75 ms
76,172 KB
testcase_12 AC 75 ms
76,316 KB
testcase_13 AC 75 ms
76,148 KB
testcase_14 AC 75 ms
76,388 KB
testcase_15 AC 74 ms
76,048 KB
testcase_16 AC 74 ms
76,208 KB
testcase_17 AC 75 ms
76,096 KB
testcase_18 AC 76 ms
76,808 KB
testcase_19 AC 76 ms
76,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

K=int(input())

DP=[[0 for i in range(27)]for j in range(21)]
DP[0][0]=1
for i in range(20):
    for j in range(21):
        if j<K:
            for k in range(1,7):
                DP[i+1][j+k]+=DP[i][j]
#print(DP)
ans=0
for i in range(21):
    for j in range(27):
        if j>=K:
            ans+=((1/6)**i)*DP[i][j]*i
print(ans)
0