結果

問題 No.2416 vs Slime
ユーザー Seed57_cashSeed57_cash
提出日時 2023-06-22 09:06:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 1,257 ms
コンパイル使用メモリ 87,352 KB
実行使用メモリ 71,836 KB
最終ジャッジ日時 2023-09-12 03:55:09
合計ジャッジ時間 7,685 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,520 KB
testcase_01 AC 69 ms
71,752 KB
testcase_02 AC 71 ms
71,424 KB
testcase_03 AC 69 ms
71,832 KB
testcase_04 AC 70 ms
71,532 KB
testcase_05 AC 69 ms
71,404 KB
testcase_06 AC 68 ms
71,580 KB
testcase_07 AC 69 ms
71,208 KB
testcase_08 AC 69 ms
71,828 KB
testcase_09 AC 69 ms
71,668 KB
testcase_10 AC 68 ms
71,752 KB
testcase_11 AC 67 ms
71,212 KB
testcase_12 AC 69 ms
71,520 KB
testcase_13 AC 69 ms
71,560 KB
testcase_14 AC 67 ms
71,440 KB
testcase_15 AC 68 ms
71,364 KB
testcase_16 AC 68 ms
71,364 KB
testcase_17 AC 69 ms
71,504 KB
testcase_18 AC 70 ms
71,516 KB
testcase_19 AC 67 ms
71,444 KB
testcase_20 AC 66 ms
71,648 KB
testcase_21 AC 68 ms
71,336 KB
testcase_22 AC 68 ms
71,180 KB
testcase_23 AC 70 ms
71,760 KB
testcase_24 AC 68 ms
71,468 KB
testcase_25 AC 67 ms
71,784 KB
testcase_26 AC 69 ms
71,516 KB
testcase_27 AC 69 ms
71,268 KB
testcase_28 AC 71 ms
71,836 KB
testcase_29 AC 69 ms
71,244 KB
testcase_30 AC 68 ms
71,440 KB
testcase_31 AC 69 ms
71,440 KB
testcase_32 AC 69 ms
71,692 KB
testcase_33 AC 68 ms
71,724 KB
testcase_34 AC 71 ms
71,400 KB
testcase_35 AC 68 ms
71,700 KB
testcase_36 AC 68 ms
71,432 KB
testcase_37 AC 69 ms
71,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 再帰を避ける解き方
# 体力の一番低いスライムをひたすら攻撃して、後からカウントする

import math


H, A = map(int, input().split())
hp_list = []
x = H
while x > 0:
	hp_list.append(x)
	x = math.floor(x / A)

res = 0
for i, hp in enumerate(hp_list):
	# hp = Hが1回、H / Aが2回、・・・攻撃される
	res += 2 ** i

print(res)
0