結果
| 問題 |
No.2217 Suffix+
|
| コンテスト | |
| ユーザー |
310icecrystal
|
| 提出日時 | 2023-06-09 20:51:29 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 425 bytes |
| コンパイル時間 | 232 ms |
| コンパイル使用メモリ | 82,372 KB |
| 実行使用メモリ | 93,436 KB |
| 最終ジャッジ日時 | 2025-01-02 01:23:41 |
| 合計ジャッジ時間 | 25,104 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 27 TLE * 6 |
ソースコード
N,K = map(int,input().split())
A = [-1] + list(map(int,input().split()))
OK = 0
NG = 10**30
while NG - OK >= 2:
MID = (OK + NG) // 2
count = 0
now_plus = 0
for i in range(1,N+1):
if A[i] + now_plus < MID:
k = -(-(MID - A[i] - now_plus) // i)
count += k
now_plus += i * k
#print(MID,count)
if count > K:
NG = MID
else:
OK = MID
print(OK)
310icecrystal