結果

問題 No.2424 Josouzai
ユーザー hirayuu_ychirayuu_yc
提出日時 2023-08-18 21:01:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 189 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 107,392 KB
最終ジャッジ日時 2024-05-06 02:24:45
合計ジャッジ時間 4,068 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,712 KB
testcase_01 AC 33 ms
51,712 KB
testcase_02 AC 34 ms
51,968 KB
testcase_03 AC 36 ms
52,096 KB
testcase_04 AC 65 ms
73,728 KB
testcase_05 AC 133 ms
102,144 KB
testcase_06 AC 120 ms
107,008 KB
testcase_07 AC 120 ms
107,264 KB
testcase_08 AC 128 ms
101,888 KB
testcase_09 AC 37 ms
51,712 KB
testcase_10 AC 52 ms
71,552 KB
testcase_11 AC 79 ms
97,920 KB
testcase_12 AC 68 ms
88,576 KB
testcase_13 AC 62 ms
73,344 KB
testcase_14 AC 83 ms
85,376 KB
testcase_15 AC 46 ms
61,568 KB
testcase_16 AC 109 ms
102,784 KB
testcase_17 AC 55 ms
68,608 KB
testcase_18 AC 59 ms
71,680 KB
testcase_19 AC 73 ms
81,920 KB
testcase_20 AC 110 ms
103,168 KB
testcase_21 AC 92 ms
93,056 KB
testcase_22 AC 62 ms
72,960 KB
testcase_23 AC 66 ms
76,928 KB
testcase_24 AC 51 ms
65,664 KB
testcase_25 AC 115 ms
107,008 KB
testcase_26 AC 96 ms
92,928 KB
testcase_27 AC 124 ms
107,136 KB
testcase_28 AC 108 ms
98,816 KB
testcase_29 AC 103 ms
96,512 KB
testcase_30 AC 53 ms
66,048 KB
testcase_31 AC 71 ms
79,872 KB
testcase_32 AC 121 ms
107,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
sum=0
ans=0
for i in range(N):
    sum+=A[i]
    if sum>K:
        sum-=A[i]
        break
    ans+=1
print(ans,K-sum)
0