結果

問題 No.5 数字のブロック
ユーザー yaoshimax
提出日時 2015-02-09 07:52:00
言語 Python2
(2.7.18)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 175 bytes
コンパイル時間 486 ms
コンパイル使用メモリ 6,824 KB
実行使用メモリ 7,040 KB
最終ジャッジ日時 2024-11-17 22:28:16
合計ジャッジ時間 1,697 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

L = int(raw_input())
N = int(raw_input())
W = map(int, raw_input().split())
W.sort()
ans = 0
for w in W:
   if L-w < 0:
      break
   else:
      L-=w
      ans+=1
print ans
0