結果

問題 No.5 数字のブロック
ユーザー zurukumo
提出日時 2019-07-13 02:27:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 5,000 ms
コード長 159 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 60,728 KB
最終ジャッジ日時 2024-11-19 09:39:01
合計ジャッジ時間 2,896 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

L = int(input())
N = int(input())
W = [int(i) for i in input().split()]

W.sort()

i = 0
while i < N and L - W[i] >= 0 :
    L -= W[i]
    i += 1
    
print(i)
0