結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー gew1fw
提出日時 2025-06-12 20:47:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 1,000 ms
コード長 506 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 82,220 KB
実行使用メモリ 51,840 KB
最終ジャッジ日時 2025-06-12 20:47:53
合計ジャッジ時間 2,836 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

# Read the input
K = int(input())

# Define the prime and composite numbers
primes = [2, 3, 5, 7, 11, 13]
composites = [4, 6, 8, 9, 10, 12]
composite_set = set(composites)

# Check for edge cases
if K == 0 or K > 156:
    print("0.000000000000000000")
else:
    count = 0
    for p in primes:
        if K % p == 0:
            c = K // p
            if c in composite_set:
                count += 1
    probability = count / 36
    # Print with 18 decimal places
    print("{0:.18f}".format(probability))
0