結果
| 問題 |
No.211 素数サイコロと合成数サイコロ (1)
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 20:50:17 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 677 bytes |
| コンパイル時間 | 456 ms |
| コンパイル使用メモリ | 82,180 KB |
| 実行使用メモリ | 80,148 KB |
| 最終ジャッジ日時 | 2025-06-12 20:55:03 |
| 合計ジャッジ時間 | 4,969 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | MLE * 33 |
ソースコード
import decimal
k = int(input())
primes = [2, 3, 5, 7, 11, 13]
composites = {4, 6, 8, 9, 10, 12}
count = 0
if k == 0:
print("0.00000000000000000")
else:
for p in primes:
if k % p != 0:
continue
c = k // p
if c in composites:
count += 1
# Compute probability with high precision
numerator = count
denominator = 36
decimal.getcontext().prec = 20 # Sufficient precision for 17 decimal places
prob = decimal.Decimal(numerator) / decimal.Decimal(denominator)
# Round to 17 decimal places
prob_rounded = prob.quantize(decimal.Decimal('1.00000000000000000'))
print("{0}".format(prob_rounded))
gew1fw