結果

問題 No.617 Nafmo、買い出しに行く
ユーザー _KingdomOfMoray_KingdomOfMoray
提出日時 2020-01-03 08:49:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 323 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 43,676 KB
最終ジャッジ日時 2024-05-02 07:04:37
合計ジャッジ時間 4,684 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
17,564 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 35 ms
10,880 KB
testcase_03 AC 283 ms
13,952 KB
testcase_04 AC 31 ms
10,880 KB
testcase_05 AC 547 ms
16,768 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

input_list = list(map(int,input().split()))
n, k = input_list
a_list = [int(input()) for i in range(n)]

res_list = []

for i in range(2 ** n):
    res_e = 0
    for j in range(n):
        if (i >> j) & 1:
            res_e += a_list[j]
    res_list.append(res_e)
    
res = max([e for e in res_list if e <= k])

print(res)
0