結果
| 問題 | 
                            No.5 数字のブロック
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-05-26 02:18:29 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 327 bytes | 
| コンパイル時間 | 123 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 56,032 KB | 
| 最終ジャッジ日時 | 2024-10-13 02:25:42 | 
| 合計ジャッジ時間 | 6,701 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 3 TLE * 1 -- * 30 | 
ソースコード
import itertools
L = int(input())
N = int(input())
W = list(map(int,input().split()))
result = []
for n in range(1,len(W)+1) :
    for conb in itertools.combinations(W, n):
        A = list(conb)
        AA = sum(A)
        if AA <= L :
            nag = len(A)
            result.append(nag)
print(max(result))