結果

問題 No.567 コンプリート
ユーザー norioc
提出日時 2025-03-17 19:47:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 308 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 82,040 KB
実行使用メモリ 54,116 KB
最終ジャッジ日時 2025-03-17 19:47:19
合計ジャッジ時間 2,223 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import comb


def f(n: int) -> float:
    res = 0
    for i in range(1, 6):   # 出ない目の個数
        cnt = comb(6, i)  # どの目が出ないか

        sgn = 1 if i % 2 == 1 else -1
        res += sgn * pow((6-i)/6, n) * cnt

    return 1 - res


N = int(input())
ans = f(N)
print(ans)
0