結果
問題 |
No.2424 Josouzai
|
ユーザー |
|
提出日時 | 2023-10-01 10:13:59 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 140 ms / 2,000 ms |
コード長 | 274 bytes |
コンパイル時間 | 123 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 32,648 KB |
最終ジャッジ日時 | 2024-07-26 13:26:15 |
合計ジャッジ時間 | 5,106 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 33 |
ソースコード
n, k = map(int, input().split()) aList = list(map(int, input().split())) aList.sort() sum = 0 nmax = 0 for i in range(n): if sum + aList[i] > k: break else: sum = sum + aList[i] nmax = nmax + 1 rest = k - sum print("%d %d" % (nmax, rest))