結果

問題 No.598 オーバーフローファンタジー
ユーザー koromooo_koromooo_
提出日時 2017-11-24 23:09:46
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 459 bytes
コンパイル時間 46 ms
コンパイル使用メモリ 6,636 KB
実行使用メモリ 10,592 KB
最終ジャッジ日時 2023-08-18 05:11:44
合計ジャッジ時間 4,091 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
10,592 KB
testcase_01 WA -
testcase_02 AC 120 ms
6,240 KB
testcase_03 AC 12 ms
5,968 KB
testcase_04 WA -
testcase_05 AC 12 ms
6,028 KB
testcase_06 AC 11 ms
6,048 KB
testcase_07 AC 12 ms
6,140 KB
testcase_08 AC 12 ms
5,968 KB
testcase_09 AC 11 ms
6,208 KB
testcase_10 AC 11 ms
6,032 KB
testcase_11 AC 11 ms
6,144 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = input()
hp = input()
attack = input()
heal = input()

def kill_by_attack(hp,attack):
    time = 0
    while True:
        if(hp < 0):
            return time
        hp -= attack
        time += 1

def kill_by_heal(n,hp,heal):
    time = 0
    over_flow_hp = 2 ** n - 2 ** (n - 1) - 1
    while True:
        if(hp >= over_flow_hp):
            return time
        hp += heal
        time += 1

print min(kill_by_attack(hp,attack),kill_by_heal(n,hp,heal))
0