結果
| 問題 |
No.2424 Josouzai
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 20:16:28 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 148 ms / 2,000 ms |
| コード長 | 285 bytes |
| コンパイル時間 | 183 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 114,664 KB |
| 最終ジャッジ日時 | 2025-03-20 20:17:06 |
| 合計ジャッジ時間 | 4,365 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
ソースコード
import bisect
n, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
prefix = [0]
for num in A:
prefix.append(prefix[-1] + num)
max_plots = bisect.bisect_right(prefix, K) - 1
remaining_chemical = K - prefix[max_plots]
print(max_plots, remaining_chemical)
lam6er