結果

問題 No.617 Nafmo、買い出しに行く
ユーザー akitsugu777akitsugu777
提出日時 2019-12-03 13:05:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 243 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 10,508 KB
実行使用メモリ 81,764 KB
最終ジャッジ日時 2023-08-18 02:07:14
合計ジャッジ時間 10,322 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,188 KB
testcase_01 AC 15 ms
8,212 KB
testcase_02 AC 18 ms
8,504 KB
testcase_03 AC 73 ms
13,792 KB
testcase_04 AC 16 ms
8,100 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 1,012 ms
81,532 KB
testcase_08 AC 16 ms
8,124 KB
testcase_09 AC 15 ms
8,084 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 1,006 ms
81,656 KB
testcase_13 AC 926 ms
80,388 KB
testcase_14 AC 1,003 ms
81,596 KB
testcase_15 AC 562 ms
56,084 KB
testcase_16 AC 573 ms
56,156 KB
testcase_17 AC 569 ms
56,200 KB
testcase_18 AC 15 ms
8,232 KB
testcase_19 WA -
testcase_20 AC 16 ms
8,072 KB
testcase_21 AC 16 ms
8,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

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

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

print(max(L3))
0