結果

問題 No.5 数字のブロック
ユーザー togatoga
提出日時 2015-02-10 02:10:58
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 174 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 7,168 KB
最終ジャッジ日時 2024-06-23 16:54:51
合計ジャッジ時間 1,660 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

L = input()
N = input()
W = map(int, raw_input().split())
s = 0
for i, x in enumerate(sorted(W)):
    if (s + x <= L):
        s += x
    else:
        print i
        break
0