結果

問題 No.617 Nafmo、買い出しに行く
ユーザー _KingdomOfMoray
提出日時 2020-01-03 08:49:36
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 323 bytes
コンパイル時間 261 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 53,504 KB
最終ジャッジ日時 2024-11-22 18:54:45
合計ジャッジ時間 32,265 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10 TLE * 10
権限があれば一括ダウンロードができます

ソースコード

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