結果

問題 No.156 キャンディー・ボックス
ユーザー minezumuminezumu
提出日時 2018-07-23 09:19:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 236 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 8,020 KB
最終ジャッジ日時 2023-08-27 01:10:30
合計ジャッジ時間 2,014 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,860 KB
testcase_01 AC 17 ms
7,864 KB
testcase_02 AC 16 ms
7,912 KB
testcase_03 AC 16 ms
7,912 KB
testcase_04 RE -
testcase_05 AC 16 ms
7,744 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 15 ms
7,900 KB
testcase_19 AC 16 ms
7,900 KB
testcase_20 AC 16 ms
7,824 KB
testcase_21 AC 16 ms
7,816 KB
testcase_22 AC 16 ms
7,740 KB
testcase_23 AC 16 ms
7,716 KB
testcase_24 AC 16 ms
7,900 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 AC 15 ms
7,844 KB
testcase_29 AC 16 ms
7,932 KB
testcase_30 AC 15 ms
7,720 KB
testcase_31 AC 16 ms
7,736 KB
testcase_32 AC 15 ms
7,748 KB
testcase_33 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
C = list(map(int,input().split()))
C = sorted(C)
counter = 0
answer = 0
for i in range(M) :
    if C[i] <= M - counter :
        counter += C[i]
        answer += 1
    else :
        break
print(answer)

0