結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー gew1fw
提出日時 2025-06-12 12:59:14
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 431 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 82,916 KB
実行使用メモリ 80,764 KB
最終ジャッジ日時 2025-06-12 13:05:52
合計ジャッジ時間 5,257 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other MLE * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import Decimal, getcontext, ROUND_HALF_UP

primes = [2, 3, 5, 7, 11, 13]
composites = [4, 6, 8, 9, 10, 12]

K = int(input())

count = 0
for p in primes:
    for c in composites:
        if p * c == K:
            count += 1

if count == 0:
    print("0.00000000000000000")
else:
    getcontext().rounding = ROUND_HALF_UP
    prob = Decimal(count) / Decimal(36)
    formatted = format(prob, '.18f')
    print(formatted)
0