結果
| 問題 | No.379 五円硬貨 |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 21:11:42 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 45 ms / 1,000 ms |
| + 521µs | |
| コード長 | 749 bytes |
| 記録 | |
| コンパイル時間 | 62 ms |
| コンパイル使用メモリ | 83,108 KB |
| 実行使用メモリ | 74,400 KB |
| 最終ジャッジ日時 | 2026-10-12 05:30:41 |
| 合計ジャッジ時間 | 2,121 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 |
ソースコード
from decimal import Decimal, getcontext
getcontext().prec = 50 # Setting a high precision to handle large numbers accurately
n, g, v = map(int, input().split())
coins = n // 5
total_gas = coins * g
# Using Decimal for high precision division
result = Decimal(str(total_gas)) / Decimal(str(v))
result = result.normalize()
# Convert result to string for formatting
result_str = format(result, 'f')
# Process the string to remove trailing zeros and unnecessary decimal points
if '.' in result_str:
integer_part, fractional_part = result_str.split('.')
fractional_part = fractional_part.rstrip('0')
if fractional_part:
print(f"{integer_part}.{fractional_part}")
else:
print(integer_part)
else:
print(result_str)
lam6er