結果

問題 No.5 数字のブロック
ユーザー K5h1n0
提出日時 2023-11-30 06:15:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 201 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 59,776 KB
最終ジャッジ日時 2024-09-26 13:49:38
合計ジャッジ時間 2,949 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

l = int(input())
n = int(input())
a = sorted(list(map(int,input().split())))
ans = 0
for i in a:
    if l - i > 0:
        l -= i
        ans += 1
    else:
        print(ans)
        exit()
print(ans)
0