結果

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

ソースコード

diff #

from decimal import Decimal

k = int(input())

if k == 0:
    print("0.00000000000000000")
else:
    primes = [2, 3, 5, 7, 11, 13]
    composites = {4, 6, 8, 9, 10, 12}
    count = 0
    
    for p in primes:
        if k % p != 0:
            continue
        c = k // p
        if c in composites:
            count += 1
    
    if count == 0:
        print("0.00000000000000000")
    else:
        prob = Decimal(count) / Decimal(36)
        print("{0:.17f}".format(prob))
0