結果

問題 No.5 数字のブロック
ユーザー brthyyjpbrthyyjp
提出日時 2020-08-29 12:54:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 187 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 82,412 KB
実行使用メモリ 60,936 KB
最終ジャッジ日時 2024-11-14 05:36:39
合計ジャッジ時間 2,872 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

l = int(input())
n = int(input())
W = list(map(int, input().split()))
W.sort()
s = 0
for i, w in enumerate(W):
    s += w
    if s > l:
        print(i)
        exit()
else:
    print(n)
0