結果

問題 No.5 数字のブロック
コンテスト
ユーザー tun
提出日時 2023-01-24 23:18:38
言語 Python3
(3.14.3 + numpy 2.4.2 + scipy 1.17.0)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 420 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 360 ms
コンパイル使用メモリ 20,700 KB
実行使用メモリ 15,488 KB
最終ジャッジ日時 2026-03-13 00:03:47
合計ジャッジ時間 4,597 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 34
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# coding: utf-8
# Your code here!

l = int(input())
n = int(input())
w = list(map(int, input().split())) #一列&スペースで並んだ複数のintデータを受け取る

w_sort = sorted(w)
#print(w_sort)

for i in range(0,n):
    l -=w_sort[i]
    print(l,i) #確認


    if l == 0:
        print(i + 1)
        break
    elif l < 0:
        print(i)
        break
    if i == n -1:
        print(n)
        break
0