結果

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

ソースコード

diff #

L,N = input(),input()
W = map(int,raw_input().split())
W.sort()
nowWidth = 0
ans = []
for width in W:
	nowWidth += width
	if nowWidth > L:
		break
	ans.append(width)
print len(ans)
0