結果

問題 No.5 数字のブロック
ユーザー かい
提出日時 2023-07-05 13:59:30
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 238 bytes
コンパイル時間 132 ms
コンパイル使用メモリ 81,836 KB
実行使用メモリ 117,584 KB
最終ジャッジ日時 2024-07-19 08:08:48
合計ジャッジ時間 6,743 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 TLE * 1 -- * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

L = int(input())
N = int(input())
W = list(map(int, input().split()))


from itertools import combinations
for i in reversed(range(1, N+1)):
    for j in combinations(W, i):
        if sum(j) <= L:
            print(i)
            exit()
0