結果
| 問題 | No.2217 Suffix+ |
| コンテスト | |
| ユーザー |
lllllll88938494
|
| 提出日時 | 2023-03-30 21:45:57 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 130 ms / 2,000 ms |
| コード長 | 521 bytes |
| 記録 | |
| コンパイル時間 | 123 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 96,772 KB |
| 最終ジャッジ日時 | 2026-04-10 12:52:45 |
| 合計ジャッジ時間 | 3,465 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
ソースコード
n,k=map(int,input().split())
a=list(map(int,input().split()))
def cal(x):
cnt = 0
now = 0
for i in range(n):
if now + a[i] < x:
t=now + a[i]
v,m=divmod(x-t,i+1)
if m>0:
v+=1
cnt += v
now += v * (i+1)
# print(cnt,x)
if cnt <= k:
return True
else:
return False
ok = 0
ng = 10 ** 15
while ng - ok > 1:
mid = (ng+ok)//2
if cal(mid):
ok = mid
else:
ng = mid
print(ok)
lllllll88938494