結果

問題 No.617 Nafmo、買い出しに行く
ユーザー akitsugu777akitsugu777
提出日時 2019-12-03 13:08:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,215 ms / 2,000 ms
コード長 245 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 84,908 KB
最終ジャッジ日時 2024-05-05 08:47:10
合計ジャッジ時間 11,580 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,752 KB
testcase_01 AC 29 ms
10,624 KB
testcase_02 AC 30 ms
11,008 KB
testcase_03 AC 93 ms
16,628 KB
testcase_04 AC 26 ms
10,624 KB
testcase_05 AC 161 ms
21,344 KB
testcase_06 AC 1,215 ms
84,720 KB
testcase_07 AC 1,176 ms
84,728 KB
testcase_08 AC 26 ms
10,880 KB
testcase_09 AC 26 ms
10,880 KB
testcase_10 AC 1,160 ms
84,724 KB
testcase_11 AC 1,171 ms
84,908 KB
testcase_12 AC 1,169 ms
84,848 KB
testcase_13 AC 1,076 ms
83,320 KB
testcase_14 AC 1,189 ms
84,720 KB
testcase_15 AC 649 ms
59,184 KB
testcase_16 AC 671 ms
59,260 KB
testcase_17 AC 666 ms
59,136 KB
testcase_18 AC 30 ms
10,880 KB
testcase_19 AC 29 ms
10,752 KB
testcase_20 AC 27 ms
10,752 KB
testcase_21 AC 29 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

N, K = map(int, input().split())
L = [int(input()) for _ in range(N)]

L3 = []
for i in range(N+1):
    L2 = list(itertools.combinations(L, i))
    for j in L2:
        if sum(j) <= K:
            L3 += [sum(j)]

print(max(L3))
0