結果

問題 No.5 数字のブロック
ユーザー nishigake
提出日時 2022-05-30 00:11:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 48 ms / 5,000 ms
コード長 155 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 82,284 KB
実行使用メモリ 60,672 KB
最終ジャッジ日時 2024-09-21 00:44:25
合計ジャッジ時間 2,898 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

L = int(input())
N = int(input())
W = list(map(int,input().split()))
W.sort()
ans = 0
for w in W:
    if w <= L:
        L -= w
        ans += 1
print(ans)
0