結果

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

ソースコード

diff #

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

W.sort()
ans = 0


for i in W:
    if L - i >= 0:
        ans += 1
        L = L - i
    else:
        break
print ans
0