結果
| 問題 | No.3758 Fan Meeting |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-09 22:10:11 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 499 bytes |
| 記録 | |
| コンパイル時間 | 68 ms |
| コンパイル使用メモリ | 82,820 KB |
| 実行使用メモリ | 132,880 KB |
| 最終ジャッジ日時 | 2026-10-09 22:10:24 |
| 合計ジャッジ時間 | 5,824 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 WA * 17 |
ソースコード
from collections import defaultdict
N, S = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
l = 0
r = max(A)
while r - l > 1:
m = (l + r) // 2
ok = True
s = S - 1
rem = 0
for a in A:
if a <= m:
break
if rem == 0:
s -= a
if s < 0:
ok = False
continue
rem = m - 1
else:
rem -= 1
if ok:
r = m
else:
l = m
print(r)