結果

問題 No.617 Nafmo、買い出しに行く
ユーザー 👑 yumechiyumechi
提出日時 2017-12-23 04:52:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 196 bytes
コンパイル時間 255 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 141,992 KB
最終ジャッジ日時 2023-08-22 15:31:14
合計ジャッジ時間 3,270 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,432 KB
testcase_01 AC 69 ms
71,456 KB
testcase_02 AC 74 ms
76,340 KB
testcase_03 AC 84 ms
84,700 KB
testcase_04 AC 69 ms
71,264 KB
testcase_05 AC 100 ms
103,840 KB
testcase_06 AC 70 ms
71,328 KB
testcase_07 AC 70 ms
71,116 KB
testcase_08 AC 71 ms
71,116 KB
testcase_09 AC 68 ms
71,268 KB
testcase_10 AC 143 ms
141,992 KB
testcase_11 AC 135 ms
133,852 KB
testcase_12 AC 127 ms
120,780 KB
testcase_13 AC 137 ms
133,556 KB
testcase_14 AC 138 ms
137,740 KB
testcase_15 AC 106 ms
103,956 KB
testcase_16 AC 105 ms
103,812 KB
testcase_17 AC 123 ms
124,116 KB
testcase_18 AC 71 ms
71,204 KB
testcase_19 AC 71 ms
71,460 KB
testcase_20 AC 70 ms
71,168 KB
testcase_21 AC 70 ms
71,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
al = sorted([int(input()) for _ in range(n)])
dp = set()
for a in al:
  for d in set(dp):
    dp.add(a + d)
  dp.add(a)
print(max([a for a in dp if a <= k] + [0]))
0