結果

問題 No.107 モンスター
ユーザー TawaraTawara
提出日時 2015-12-30 21:56:08
言語 Python2
(2.7.18)
結果
AC  
実行時間 175 ms / 5,000 ms
コード長 249 bytes
コンパイル時間 690 ms
コンパイル使用メモリ 6,664 KB
実行使用メモリ 9,732 KB
最終ジャッジ日時 2023-08-25 02:37:57
合計ジャッジ時間 3,278 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,024 KB
testcase_01 AC 11 ms
6,008 KB
testcase_02 AC 11 ms
6,092 KB
testcase_03 AC 11 ms
6,184 KB
testcase_04 AC 12 ms
6,092 KB
testcase_05 AC 11 ms
5,960 KB
testcase_06 AC 11 ms
5,944 KB
testcase_07 AC 11 ms
5,988 KB
testcase_08 AC 11 ms
6,064 KB
testcase_09 AC 12 ms
6,092 KB
testcase_10 AC 12 ms
5,984 KB
testcase_11 AC 12 ms
6,028 KB
testcase_12 AC 11 ms
6,020 KB
testcase_13 AC 81 ms
6,904 KB
testcase_14 AC 161 ms
8,228 KB
testcase_15 AC 162 ms
8,176 KB
testcase_16 AC 12 ms
5,984 KB
testcase_17 AC 32 ms
6,652 KB
testcase_18 AC 37 ms
9,304 KB
testcase_19 AC 36 ms
9,140 KB
testcase_20 AC 105 ms
7,020 KB
testcase_21 AC 73 ms
7,164 KB
testcase_22 AC 133 ms
7,796 KB
testcase_23 AC 175 ms
9,732 KB
testcase_24 AC 112 ms
9,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=input();D=map(int,raw_input().split());T=1<<N
H=[0]*T;M=[0]*T;H[0]=M[0]=100
for i in range(T):
	if H[i]==0:continue
	for j in range(N):
		b=1<<j
		if b&i:continue
		n=b+i;h=min(H[i]+D[j],M[i])
		H[n]=max(H[n],h);M[n]=M[i]+100*(D[j]<0)
print H[T-1]
0