結果

問題 No.2424 Josouzai
ユーザー 👑 timitimi
提出日時 2023-08-18 21:13:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 200 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 109,696 KB
最終ジャッジ日時 2024-05-06 02:52:07
合計ジャッジ時間 4,102 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
51,584 KB
testcase_01 AC 36 ms
51,584 KB
testcase_02 AC 35 ms
51,968 KB
testcase_03 AC 35 ms
51,968 KB
testcase_04 AC 64 ms
74,368 KB
testcase_05 AC 137 ms
101,760 KB
testcase_06 AC 132 ms
108,928 KB
testcase_07 AC 131 ms
108,672 KB
testcase_08 AC 127 ms
101,760 KB
testcase_09 AC 36 ms
51,840 KB
testcase_10 AC 52 ms
72,192 KB
testcase_11 AC 80 ms
99,456 KB
testcase_12 AC 69 ms
90,112 KB
testcase_13 AC 64 ms
74,112 KB
testcase_14 AC 83 ms
86,400 KB
testcase_15 AC 48 ms
62,080 KB
testcase_16 AC 120 ms
104,064 KB
testcase_17 AC 62 ms
69,760 KB
testcase_18 AC 61 ms
72,064 KB
testcase_19 AC 79 ms
82,816 KB
testcase_20 AC 111 ms
104,704 KB
testcase_21 AC 94 ms
93,824 KB
testcase_22 AC 63 ms
73,472 KB
testcase_23 AC 68 ms
77,824 KB
testcase_24 AC 51 ms
66,688 KB
testcase_25 AC 121 ms
109,696 KB
testcase_26 AC 100 ms
94,208 KB
testcase_27 AC 127 ms
108,800 KB
testcase_28 AC 110 ms
100,224 KB
testcase_29 AC 107 ms
97,920 KB
testcase_30 AC 57 ms
66,816 KB
testcase_31 AC 79 ms
80,768 KB
testcase_32 AC 127 ms
108,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int, input().split())
A=list(map(int, input().split()))
A=sorted(A)
if K>=sum(A):
  print(N,K-sum(A))
  exit()
  
for i in range(N):
  if K>=A[i]:
    K-=A[i]
  else:
    print(i,K)
    exit()
0