結果

問題 No.5 数字のブロック
ユーザー kutsutama
提出日時 2018-02-27 23:38:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 36 ms / 5,000 ms
コード長 174 bytes
コンパイル時間 448 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,648 KB
最終ジャッジ日時 2024-11-18 12:06:19
合計ジャッジ時間 2,616 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

L = int(input())
n = int(input())
w = [int(x) for x in input().split()]

w.sort()
s = 0
res = 0
for ww in w:
  s += ww
  if s > L:
    break
  else:
    res += 1

print(res)
0