結果
| 問題 | No.2424 Josouzai |
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 18:40:12 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 125 ms / 2,000 ms |
| コード長 | 285 bytes |
| 記録 | |
| コンパイル時間 | 244 ms |
| コンパイル使用メモリ | 96,624 KB |
| 実行使用メモリ | 132,096 KB |
| 最終ジャッジ日時 | 2026-07-07 07:14:47 |
| 合計ジャッジ時間 | 6,248 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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