結果

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

ソースコード

diff #

inp1 = input()
inp_dust = input()
inp2 = input().split()

seq= []
for s in inp2:
    seq.append(int(s))

seq = sorted(seq)
num = int(inp1)

box = 0
count = 0
for s in seq:
    box = box + s
    count = count + 1
    if box == num:
        break
    elif box >= num:
        count = count - 1
        break


print(count)
0