結果

問題 No.5 数字のブロック
ユーザー yoshiisland_dev
提出日時 2016-11-27 15:41:29
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 401 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2024-11-27 12:11:11
合計ジャッジ時間 2,169 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

def main():
    a = int(input())
    b = int(input())
    c = [int(x) for x in input().split()]

    c.sort()
    y = []

    for i in c:
        if sum(y)+i < a:
            y.append(int(i))
            sum(y)

    else:
        ans = len(y)
        if ans > b:
            print("error")
        else:
            print(ans)

    pass

if __name__ == "__main__":
    main()
0