結果

問題 No.2424 Josouzai
ユーザー 👑 colognecologne
提出日時 2023-08-20 16:19:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 262 bytes
コンパイル時間 465 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 107,392 KB
最終ジャッジ日時 2024-05-07 22:37:27
合計ジャッジ時間 5,057 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
51,840 KB
testcase_01 AC 33 ms
52,096 KB
testcase_02 AC 37 ms
51,712 KB
testcase_03 AC 32 ms
52,224 KB
testcase_04 AC 61 ms
73,600 KB
testcase_05 AC 123 ms
101,888 KB
testcase_06 AC 115 ms
107,392 KB
testcase_07 AC 115 ms
107,264 KB
testcase_08 AC 124 ms
101,948 KB
testcase_09 AC 36 ms
51,712 KB
testcase_10 AC 50 ms
71,552 KB
testcase_11 AC 75 ms
98,064 KB
testcase_12 AC 65 ms
88,832 KB
testcase_13 AC 60 ms
73,216 KB
testcase_14 AC 78 ms
85,632 KB
testcase_15 AC 43 ms
61,696 KB
testcase_16 AC 106 ms
102,784 KB
testcase_17 AC 54 ms
68,864 KB
testcase_18 AC 58 ms
71,552 KB
testcase_19 AC 73 ms
82,228 KB
testcase_20 AC 106 ms
103,140 KB
testcase_21 AC 88 ms
92,416 KB
testcase_22 AC 60 ms
72,704 KB
testcase_23 AC 63 ms
76,672 KB
testcase_24 AC 50 ms
65,664 KB
testcase_25 AC 112 ms
107,264 KB
testcase_26 AC 88 ms
92,672 KB
testcase_27 AC 114 ms
107,264 KB
testcase_28 AC 101 ms
98,432 KB
testcase_29 AC 95 ms
96,896 KB
testcase_30 AC 50 ms
66,048 KB
testcase_31 AC 67 ms
79,488 KB
testcase_32 AC 113 ms
107,136 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