結果

問題 No.211 素数サイコロと合成数サイコロ (1)
コンテスト
ユーザー gew1fw
提出日時 2025-06-12 20:47:07
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 506 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 228 ms
コンパイル使用メモリ 95,988 KB
実行使用メモリ 79,360 KB
最終ジャッジ日時 2026-07-12 01:24:21
合計ジャッジ時間 3,810 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other MLE * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# 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