結果

問題 No.5 数字のブロック
コンテスト
ユーザー niyarin
提出日時 2016-02-16 22:03:28
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 83 ms / 5,000 ms
コード長 165 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 77,624 KB
最終ジャッジ日時 2025-12-03 19:24:40
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

L = input()
N = input()
W = map(int,raw_input().split(" "))

W.sort()
ans = 0
cnt = 0
for w in W:
    cnt += w
    if cnt > L:
        break
    ans += 1
print ans

0