結果

問題 No.617 Nafmo、買い出しに行く
ユーザー cielciel
提出日時 2017-12-24 22:46:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 272 ms / 2,000 ms
コード長 161 bytes
コンパイル時間 518 ms
コンパイル使用メモリ 82,392 KB
実行使用メモリ 105,856 KB
最終ジャッジ日時 2024-05-09 23:55:31
合計ジャッジ時間 3,444 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
70,576 KB
testcase_01 AC 41 ms
58,892 KB
testcase_02 AC 70 ms
70,900 KB
testcase_03 AC 115 ms
78,160 KB
testcase_04 AC 49 ms
63,908 KB
testcase_05 AC 169 ms
89,520 KB
testcase_06 AC 265 ms
105,856 KB
testcase_07 AC 267 ms
105,796 KB
testcase_08 AC 36 ms
52,304 KB
testcase_09 AC 36 ms
52,580 KB
testcase_10 AC 233 ms
98,836 KB
testcase_11 AC 272 ms
104,836 KB
testcase_12 AC 164 ms
85,568 KB
testcase_13 AC 124 ms
76,416 KB
testcase_14 AC 147 ms
82,380 KB
testcase_15 AC 39 ms
57,448 KB
testcase_16 AC 42 ms
59,080 KB
testcase_17 AC 37 ms
52,320 KB
testcase_18 AC 35 ms
52,880 KB
testcase_19 AC 37 ms
53,320 KB
testcase_20 AC 37 ms
52,308 KB
testcase_21 AC 38 ms
53,356 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