結果

問題 No.2424 Josouzai
ユーザー taro2023taro2023
提出日時 2023-08-18 22:43:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 254 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 33,392 KB
最終ジャッジ日時 2024-05-06 05:06:03
合計ジャッジ時間 4,224 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,752 KB
testcase_01 AC 27 ms
10,752 KB
testcase_02 AC 26 ms
10,752 KB
testcase_03 AC 25 ms
10,752 KB
testcase_04 AC 57 ms
17,268 KB
testcase_05 AC 139 ms
33,388 KB
testcase_06 AC 139 ms
33,100 KB
testcase_07 AC 147 ms
33,096 KB
testcase_08 AC 141 ms
33,392 KB
testcase_09 AC 27 ms
10,752 KB
testcase_10 AC 46 ms
16,388 KB
testcase_11 AC 84 ms
28,256 KB
testcase_12 AC 68 ms
23,200 KB
testcase_13 AC 59 ms
17,320 KB
testcase_14 AC 83 ms
22,584 KB
testcase_15 AC 34 ms
12,544 KB
testcase_16 AC 128 ms
29,804 KB
testcase_17 AC 49 ms
15,596 KB
testcase_18 AC 55 ms
16,648 KB
testcase_19 AC 78 ms
21,564 KB
testcase_20 AC 122 ms
29,948 KB
testcase_21 AC 99 ms
26,308 KB
testcase_22 AC 56 ms
17,196 KB
testcase_23 AC 63 ms
18,832 KB
testcase_24 AC 43 ms
14,332 KB
testcase_25 AC 131 ms
31,412 KB
testcase_26 AC 104 ms
25,476 KB
testcase_27 AC 139 ms
31,976 KB
testcase_28 AC 118 ms
28,744 KB
testcase_29 AC 108 ms
28,324 KB
testcase_30 AC 44 ms
14,648 KB
testcase_31 AC 73 ms
20,136 KB
testcase_32 AC 136 ms
31,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b= map(int, input().split())
c = list(map(int, input().split()))
c=sorted(c)
e=0
if c[0]>b:
    print(0,b-c[0])
    exit()
for i in range(len(c)):
    e+=c[i]
    if e>b:
        e-=c[i]
        break
if i==0:
    print(i+1,b-e)
else:
    print(i,b-e)
0