結果
問題 |
No.598 オーバーフローファンタジー
|
ユーザー |
![]() |
提出日時 | 2017-11-24 23:12:22 |
言語 | Python2 (2.7.18) |
結果 |
TLE
|
実行時間 | - |
コード長 | 458 bytes |
コンパイル時間 | 167 ms |
コンパイル使用メモリ | 7,076 KB |
実行使用メモリ | 13,640 KB |
最終ジャッジ日時 | 2024-11-27 08:02:16 |
合計ジャッジ時間 | 19,296 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 WA * 1 TLE * 6 |
ソースコード
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))