結果

問題 No.5 数字のブロック
ユーザー aaaaaaaaaa2230
提出日時 2021-04-05 10:29:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 55 ms / 5,000 ms
コード長 181 bytes
コンパイル時間 420 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 59,904 KB
最終ジャッジ日時 2024-12-30 13:04:02
合計ジャッジ時間 3,182 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

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