結果
問題 | No.598 オーバーフローファンタジー |
ユーザー |
![]() |
提出日時 | 2017-11-24 23:28:22 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 15 ms / 2,000 ms |
コード長 | 408 bytes |
コンパイル時間 | 162 ms |
コンパイル使用メモリ | 6,784 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2024-12-26 01:56:03 |
合計ジャッジ時間 | 1,741 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
n = input()hp = input()attack = input()heal = input()def kill_by_attack(hp,attack):time = hp / attackif(hp%attack != 0):time += 1return timedef kill_by_heal(n,hp,heal):over_flow_hp = 2 ** n - 2 ** (n - 1)time = (over_flow_hp-hp)/healif((over_flow_hp-hp)%heal != 0):time += 1return timeprint min(kill_by_attack(hp,attack),kill_by_heal(n,hp,heal))