結果

問題 No.2424 Josouzai
ユーザー 👑 colognecologne
提出日時 2023-08-20 16:19:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 262 bytes
コンパイル時間 449 ms
コンパイル使用メモリ 87,344 KB
実行使用メモリ 103,576 KB
最終ジャッジ日時 2023-08-20 16:20:06
合計ジャッジ時間 8,902 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,456 KB
testcase_01 AC 73 ms
71,440 KB
testcase_02 AC 71 ms
71,340 KB
testcase_03 AC 73 ms
71,640 KB
testcase_04 AC 95 ms
84,384 KB
testcase_05 AC 156 ms
101,600 KB
testcase_06 AC 156 ms
102,044 KB
testcase_07 AC 156 ms
101,708 KB
testcase_08 AC 157 ms
101,552 KB
testcase_09 AC 72 ms
71,400 KB
testcase_10 AC 84 ms
83,784 KB
testcase_11 AC 107 ms
103,576 KB
testcase_12 AC 100 ms
97,140 KB
testcase_13 AC 95 ms
84,288 KB
testcase_14 AC 120 ms
93,404 KB
testcase_15 AC 79 ms
76,352 KB
testcase_16 AC 145 ms
99,728 KB
testcase_17 AC 90 ms
81,172 KB
testcase_18 AC 91 ms
83,172 KB
testcase_19 AC 107 ms
91,108 KB
testcase_20 AC 146 ms
99,912 KB
testcase_21 AC 123 ms
98,600 KB
testcase_22 AC 95 ms
84,340 KB
testcase_23 AC 106 ms
87,344 KB
testcase_24 AC 84 ms
79,472 KB
testcase_25 AC 153 ms
102,168 KB
testcase_26 AC 124 ms
98,536 KB
testcase_27 AC 153 ms
100,632 KB
testcase_28 AC 137 ms
102,160 KB
testcase_29 AC 130 ms
101,724 KB
testcase_30 AC 86 ms
79,772 KB
testcase_31 AC 104 ms
89,236 KB
testcase_32 AC 163 ms
100,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N, K = map(int, input().split())
    A = sorted(map(int, input().split()))
    c = 0
    for a in A:
        if K >= a:
            K -= a
            c += 1
        else:
            break
    print(c, K)


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