結果

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

ソースコード

diff #

import decimal

K = int(input())

prime_dice = [2, 3, 5, 7, 11, 13]
composite_set = {4, 6, 8, 9, 10, 12}

count = 0

for p in prime_dice:
    if K != 0 and (K % p) == 0:
        c = K // p
        if c in composite_set:
            count += 1

if count == 0:
    print("0.00000000000000000")
else:
    decimal.getcontext().prec = 20
    prob = decimal.Decimal(count) / decimal.Decimal(36)
    formatted = format(prob, '0.18f')
    print(formatted)
0