結果
| 問題 |
No.598 オーバーフローファンタジー
|
| コンテスト | |
| ユーザー |
koromooo_
|
| 提出日時 | 2017-11-24 23:09:46 |
| 言語 | Python2 (2.7.18) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 459 bytes |
| コンパイル時間 | 48 ms |
| コンパイル使用メモリ | 6,912 KB |
| 実行使用メモリ | 13,640 KB |
| 最終ジャッジ日時 | 2024-11-27 08:00:00 |
| 合計ジャッジ時間 | 19,254 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 20 WA * 2 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))
koromooo_