結果

問題 No.617 Nafmo、買い出しに行く
ユーザー cielciel
提出日時 2017-12-24 22:46:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 304 ms / 2,000 ms
コード長 161 bytes
コンパイル時間 1,418 ms
コンパイル使用メモリ 86,552 KB
実行使用メモリ 123,372 KB
最終ジャッジ日時 2023-08-22 18:06:50
合計ジャッジ時間 4,850 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
83,876 KB
testcase_01 AC 78 ms
75,552 KB
testcase_02 AC 106 ms
84,356 KB
testcase_03 AC 150 ms
92,148 KB
testcase_04 AC 82 ms
78,728 KB
testcase_05 AC 202 ms
102,360 KB
testcase_06 AC 300 ms
122,504 KB
testcase_07 AC 298 ms
123,372 KB
testcase_08 AC 72 ms
70,664 KB
testcase_09 AC 72 ms
70,664 KB
testcase_10 AC 265 ms
109,612 KB
testcase_11 AC 304 ms
116,484 KB
testcase_12 AC 204 ms
97,720 KB
testcase_13 AC 155 ms
88,892 KB
testcase_14 AC 182 ms
93,332 KB
testcase_15 AC 76 ms
74,720 KB
testcase_16 AC 76 ms
75,736 KB
testcase_17 AC 73 ms
71,092 KB
testcase_18 AC 72 ms
71,016 KB
testcase_19 AC 72 ms
70,784 KB
testcase_20 AC 74 ms
71,140 KB
testcase_21 AC 72 ms
70,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
n,k,*a=map(int,sys.stdin.read().split())
bag=[0]+[-float('inf')]*k
for e in a:
	for i in range(k,e-1,-1):bag[i]=max(bag[i],bag[i-e]+e)
print(max(bag))
0