結果
| 問題 |
No.211 素数サイコロと合成数サイコロ (1)
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 13:06:46 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 531 bytes |
| コンパイル時間 | 190 ms |
| コンパイル使用メモリ | 82,688 KB |
| 実行使用メモリ | 80,896 KB |
| 最終ジャッジ日時 | 2025-06-12 13:11:31 |
| 合計ジャッジ時間 | 5,484 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | MLE * 33 |
ソースコード
from decimal import Decimal, ROUND_HALF_UP, getcontext
getcontext().rounding = ROUND_HALF_UP
K = int(input())
if K == 0:
print("0.000000000000000000")
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
prob = Decimal(count) / Decimal(36)
formatted = prob.quantize(Decimal('1.000000000000000000'), rounding=ROUND_HALF_UP)
print(formatted)
gew1fw