結果

問題 No.5 数字のブロック
ユーザー nsd_fb
提出日時 2015-02-19 03:55:12
言語 Python2
(2.7.18)
結果
AC  
実行時間 18 ms / 5,000 ms
コード長 164 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 6,820 KB
実行使用メモリ 7,168 KB
最終ジャッジ日時 2024-11-17 22:30:18
合計ジャッジ時間 1,684 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

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

W.sort()

S = 0
for i in xrange(N):
    S += W[i]
    if S > L:
        print i
        exit(0)

print N
0