結果
| 問題 | No.567 コンプリート | 
| コンテスト | |
| ユーザー |  lam6er | 
| 提出日時 | 2025-03-20 21:18:29 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 257 ms / 2,000 ms | 
| コード長 | 458 bytes | 
| コンパイル時間 | 171 ms | 
| コンパイル使用メモリ | 82,440 KB | 
| 実行使用メモリ | 82,580 KB | 
| 最終ジャッジ日時 | 2025-03-20 21:19:38 | 
| 合計ジャッジ時間 | 4,817 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 12 | 
ソースコード
import math
from decimal import Decimal, getcontext
# Set a high precision to handle large exponents accurately
getcontext().prec = 1000
n = int(input())
sum_p = Decimal(0)
for k in range(0, 7):
    comb = math.comb(6, k)
    sign = (-1) ** k
    term = Decimal(comb) * Decimal(sign) * (Decimal(6 - k) / Decimal(6)) ** n
    sum_p += term
# Format the output to print up to 12 decimal places, trailing zeros may be omitted
print("{0:.12f}".format(sum_p))
            
            
            
        