結果

問題 No.156 キャンディー・ボックス
ユーザー pypypymipypypymi
提出日時 2022-02-14 16:37:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 257 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 71,404 KB
最終ジャッジ日時 2023-09-11 16:44:05
合計ジャッジ時間 4,499 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
70,876 KB
testcase_01 AC 68 ms
70,988 KB
testcase_02 AC 67 ms
71,088 KB
testcase_03 AC 69 ms
70,988 KB
testcase_04 AC 74 ms
71,296 KB
testcase_05 AC 70 ms
71,060 KB
testcase_06 AC 70 ms
71,184 KB
testcase_07 AC 69 ms
71,120 KB
testcase_08 AC 70 ms
71,276 KB
testcase_09 AC 69 ms
71,404 KB
testcase_10 AC 66 ms
71,120 KB
testcase_11 AC 66 ms
71,244 KB
testcase_12 AC 68 ms
71,204 KB
testcase_13 AC 69 ms
70,932 KB
testcase_14 AC 67 ms
71,328 KB
testcase_15 AC 68 ms
71,236 KB
testcase_16 AC 66 ms
71,300 KB
testcase_17 AC 70 ms
71,324 KB
testcase_18 AC 67 ms
71,340 KB
testcase_19 AC 67 ms
71,180 KB
testcase_20 AC 67 ms
71,336 KB
testcase_21 AC 68 ms
71,176 KB
testcase_22 AC 67 ms
71,264 KB
testcase_23 AC 68 ms
70,872 KB
testcase_24 AC 68 ms
71,156 KB
testcase_25 AC 65 ms
71,084 KB
testcase_26 AC 69 ms
71,304 KB
testcase_27 AC 68 ms
71,172 KB
testcase_28 AC 67 ms
71,172 KB
testcase_29 AC 64 ms
71,236 KB
testcase_30 AC 66 ms
70,992 KB
testcase_31 AC 65 ms
71,328 KB
testcase_32 AC 65 ms
71,044 KB
testcase_33 AC 66 ms
71,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
carray = list(sorted(map(int,input().split())))
result = 0
for i in range(1,n+1):
    v = sum(carray[:i])
    if v-m>=0:
        if v-m==0:
            result=i
        else:
            result=i-1
        break
print(result)
0