結果

問題 No.107 モンスター
ユーザー yuki2006yuki2006
提出日時 2014-11-01 23:44:26
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 546 bytes
コンパイル時間 599 ms
コンパイル使用メモリ 6,488 KB
実行使用メモリ 6,124 KB
最終ジャッジ日時 2023-08-29 00:13:34
合計ジャッジ時間 1,582 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,088 KB
testcase_01 AC 11 ms
5,968 KB
testcase_02 AC 11 ms
5,848 KB
testcase_03 WA -
testcase_04 AC 11 ms
5,992 KB
testcase_05 AC 11 ms
6,076 KB
testcase_06 AC 11 ms
6,088 KB
testcase_07 AC 10 ms
5,836 KB
testcase_08 AC 10 ms
5,884 KB
testcase_09 AC 10 ms
6,092 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 10 ms
5,832 KB
testcase_13 AC 10 ms
5,844 KB
testcase_14 AC 11 ms
5,864 KB
testcase_15 WA -
testcase_16 AC 10 ms
5,836 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
D = sorted(map(int, raw_input().split()))
maxHP = 100
HP = 100
change = True
while change:
    change = False
    for i, v in enumerate(D):
        if v == 0:
            pass
        elif v < 0:
            if HP + v > 0:
                HP += v
                maxHP += 100
                D[i] = 0
                change = True
        else:
            if HP + v <= maxHP:
                HP += v
                D[i] = 0
                change = True
if min(D) < 0:
    print 0
else:
    print HP
0