結果
| 問題 | 
                            No.5 数字のブロック
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-06-06 12:59:37 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 336 bytes | 
| コンパイル時間 | 184 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 17,824 KB | 
| 最終ジャッジ日時 | 2024-09-21 04:36:18 | 
| 合計ジャッジ時間 | 6,698 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 2 RE * 1 TLE * 1 -- * 30 | 
ソースコード
L = int(input())
N = int(input())
W = list(map(int,input().split()))
for i in range(N):
    for j in range(N):
        if W[j] >= W[i]:
            tmp = W[j]
            W[j] = W[i]
            W[i] = tmp
sum_wide = 0
ans = 0
while True:
    if sum_wide + W[ans] > L:
        break
    sum_wide += W[ans]
    ans += 1
print(ans)