結果
| 問題 | No.2424 Josouzai |
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 18:40:12 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 105 ms / 2,000 ms |
| + 80µs | |
| コード長 | 285 bytes |
| 記録 | |
| コンパイル時間 | 91 ms |
| コンパイル使用メモリ | 65,108 KB |
| 実行使用メモリ | 90,016 KB |
| 最終ジャッジ日時 | 2026-10-15 02:09:44 |
| 合計ジャッジ時間 | 5,040 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
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