結果
| 問題 | 
                            No.5 数字のブロック
                             | 
                    
| コンテスト | |
| ユーザー | 
                             takopom55
                         | 
                    
| 提出日時 | 2016-11-27 15:24:15 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 32 ms / 5,000 ms | 
| コード長 | 361 bytes | 
| コンパイル時間 | 102 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 11,648 KB | 
| 最終ジャッジ日時 | 2024-11-18 10:46:05 | 
| 合計ジャッジ時間 | 1,901 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 34 | 
ソースコード
# -*- coding: utf-8 -*- 
def main():
    L = int(input())
    N = int(input())
    W = [int(w) for w in input().split()]
    length = 0
    count = 0    
    W = sorted(W)
    for w in W:
        if (length + w) <= L:
            count += 1
            length += w
        else:
            break
    
    print(count)
if __name__ == '__main__':
    main()
            
            
            
        
            
takopom55