結果
| 問題 | No.2416 vs Slime |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-12 14:35:24 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 477 bytes |
| 記録 | |
| コンパイル時間 | 698 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 21,008 KB |
| 最終ジャッジ日時 | 2026-05-14 00:56:52 |
| 合計ジャッジ時間 | 14,636 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 37 |
ソースコード
def min_attacks_to_defeat_slime(H, a):
# Base case: if the strength of the slime is less than or equal to 0, no attack needed
if H <= 0:
return 0
# Recursively attack two new slimes with health H//a
return 1 + min(min_attacks_to_defeat_slime(H // a, a), min_attacks_to_defeat_slime(H // a + (H % a), a))
H,a = map(int,input().split())
result = min_attacks_to_defeat_slime(H, a)
print("Minimum attacks to defeat a slime with strength", H, ":", result)