結果

問題 No.2217 Suffix+
ユーザー googol_S0googol_S0
提出日時 2023-02-17 21:23:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 252 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 880 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 93,192 KB
最終ジャッジ日時 2023-09-26 18:27:07
合計ジャッジ時間 8,119 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,312 KB
testcase_01 AC 72 ms
71,296 KB
testcase_02 AC 72 ms
71,372 KB
testcase_03 AC 73 ms
71,124 KB
testcase_04 AC 74 ms
71,012 KB
testcase_05 AC 73 ms
71,012 KB
testcase_06 AC 74 ms
71,012 KB
testcase_07 AC 75 ms
71,172 KB
testcase_08 AC 74 ms
71,240 KB
testcase_09 AC 74 ms
70,960 KB
testcase_10 AC 73 ms
71,120 KB
testcase_11 AC 74 ms
71,240 KB
testcase_12 AC 74 ms
71,176 KB
testcase_13 AC 74 ms
71,176 KB
testcase_14 AC 117 ms
78,628 KB
testcase_15 AC 117 ms
78,464 KB
testcase_16 AC 154 ms
83,296 KB
testcase_17 AC 134 ms
80,844 KB
testcase_18 AC 123 ms
79,672 KB
testcase_19 AC 230 ms
87,796 KB
testcase_20 AC 212 ms
86,032 KB
testcase_21 AC 102 ms
76,448 KB
testcase_22 AC 220 ms
87,428 KB
testcase_23 AC 189 ms
83,692 KB
testcase_24 AC 216 ms
92,576 KB
testcase_25 AC 214 ms
92,808 KB
testcase_26 AC 214 ms
92,904 KB
testcase_27 AC 216 ms
92,640 KB
testcase_28 AC 215 ms
92,888 KB
testcase_29 AC 244 ms
92,996 KB
testcase_30 AC 243 ms
93,080 KB
testcase_31 AC 245 ms
93,148 KB
testcase_32 AC 252 ms
93,192 KB
testcase_33 AC 243 ms
93,140 KB
testcase_34 AC 213 ms
92,956 KB
testcase_35 AC 73 ms
71,176 KB
testcase_36 AC 247 ms
93,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
A=list(map(int,input().split()))
L,R=0,10**18
while L<R:
  M=(L+R+1)>>1
  C=0
  D=0
  for i in range(N):
    V=(M-(A[i]+C)+i)//(i+1)
    if V>0:
      C+=V*(i+1)
      D+=V
  if D<=K:
    L=M
  else:
    R=min(R-1,M)
print(L)
0