結果

問題 No.5 数字のブロック
ユーザー gorugo30gorugo30
提出日時 2021-02-22 18:56:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 43 ms / 5,000 ms
コード長 145 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 82,224 KB
実行使用メモリ 59,776 KB
最終ジャッジ日時 2024-09-21 14:57:11
合計ジャッジ時間 2,485 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

L = int(input())
N = int(input())
W = list(map(int, input().split()))
W.sort()
i = 0
while i < N and W[i] <= L:
    L -= W[i]
    i += 1
print(i)
0