結果

問題 No.598 オーバーフローファンタジー
ユーザー Kozuma
提出日時 2018-01-19 17:21:31
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 268 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 20,864 KB
最終ジャッジ日時 2024-12-24 12:07:12
合計ジャッジ時間 20,768 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 TLE * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
X = int(input())
A = int(input())
B = int(input())

max_health = 2**(N -1) - 1

attack = 0
heal = 0

HP = X
while HP > 0:
	HP -= A
	attack += 1

HP = X
while HP <= max_health:
	HP += B
	heal += 1

if attack >= heal:
	print(heal)
else:
	print(attack)

0