結果

問題 No.598 オーバーフローファンタジー
ユーザー koromooo_koromooo_
提出日時 2017-11-24 23:21:22
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 412 bytes
コンパイル時間 510 ms
コンパイル使用メモリ 6,692 KB
実行使用メモリ 6,252 KB
最終ジャッジ日時 2023-08-18 05:20:19
合計ジャッジ時間 2,336 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,068 KB
testcase_01 WA -
testcase_02 AC 11 ms
6,160 KB
testcase_03 AC 11 ms
5,976 KB
testcase_04 WA -
testcase_05 AC 11 ms
6,040 KB
testcase_06 AC 11 ms
6,044 KB
testcase_07 AC 11 ms
5,968 KB
testcase_08 AC 11 ms
5,976 KB
testcase_09 AC 11 ms
6,044 KB
testcase_10 AC 11 ms
6,164 KB
testcase_11 AC 12 ms
6,000 KB
testcase_12 AC 11 ms
6,064 KB
testcase_13 AC 12 ms
6,176 KB
testcase_14 AC 11 ms
5,996 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 11 ms
6,160 KB
testcase_18 AC 12 ms
6,120 KB
testcase_19 AC 11 ms
6,040 KB
testcase_20 AC 11 ms
5,972 KB
testcase_21 AC 12 ms
5,972 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 11 ms
6,172 KB
testcase_25 AC 11 ms
6,164 KB
testcase_26 AC 11 ms
5,996 KB
testcase_27 AC 11 ms
5,968 KB
testcase_28 AC 11 ms
6,044 KB
testcase_29 AC 11 ms
6,036 KB
testcase_30 AC 11 ms
6,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def kill_by_attack(hp,attack):
    time = hp / attack
    if(hp%attack != 0):
        time += 1
    return time

def kill_by_heal(n,hp,heal):
    over_flow_hp = 2 ** n - 2 ** (n - 1) - 1
    time = (over_flow_hp-hp)/heal
    if((over_flow_hp-hp)%heal != 0):
        time += 1
    return time

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