結果
問題 | No.2217 Suffix+ |
ユーザー |
|
提出日時 | 2023-02-18 17:34:26 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 186 ms / 2,000 ms |
コード長 | 490 bytes |
コンパイル時間 | 220 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 92,160 KB |
最終ジャッジ日時 | 2024-07-20 02:48:30 |
合計ジャッジ時間 | 4,885 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
N,K = map(int,input().split()) A = list(map(int,input().split())) end = 10 ** 15 start = 0 def calc(mid): n = 0 now = 0 for i in range(N): a = A[i] if a + now < mid: u = (mid - a - now + i) // (i + 1) n += u now += u * (i + 1) if n > K:return False return True while end - start > 1: mid = end + start >> 1 if not calc(mid): end = mid else: start = mid print(start)