結果

問題 No.5 数字のブロック
ユーザー マウスジェリー
提出日時 2020-05-26 03:00:04
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 359 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 59,536 KB
最終ジャッジ日時 2024-10-13 02:27:18
合計ジャッジ時間 6,602 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 TLE * 1 -- * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import itertools
L = int(sys.stdin.readline().strip())
N = int(sys.stdin.readline().strip())
W = list(map(int,sys.stdin.readline().strip().split()))
result = []
for n in range(1,N+1) :
    for conb in itertools.combinations(W, n):
        A = list(conb)

        if sum(A) <= L :
            result.append(len(A))

print(max(result))
0