結果

問題 No.5 数字のブロック
ユーザー niyarin
提出日時 2016-02-16 22:03:28
言語 Python2
(2.7.18)
結果
AC  
実行時間 15 ms / 5,000 ms
コード長 165 bytes
コンパイル時間 54 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 7,168 KB
最終ジャッジ日時 2024-11-18 08:15:25
合計ジャッジ時間 1,145 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

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