結果

問題 No.2217 Suffix+
ユーザー 👑 timitimi
提出日時 2023-02-17 21:40:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 240 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 86,448 KB
実行使用メモリ 93,176 KB
最終ジャッジ日時 2023-09-26 18:54:41
合計ジャッジ時間 6,201 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
70,968 KB
testcase_01 AC 73 ms
71,084 KB
testcase_02 AC 74 ms
70,908 KB
testcase_03 AC 74 ms
71,012 KB
testcase_04 AC 74 ms
71,132 KB
testcase_05 AC 74 ms
71,096 KB
testcase_06 AC 75 ms
70,992 KB
testcase_07 AC 75 ms
71,012 KB
testcase_08 AC 74 ms
70,876 KB
testcase_09 AC 73 ms
70,708 KB
testcase_10 AC 74 ms
71,008 KB
testcase_11 AC 75 ms
71,084 KB
testcase_12 AC 74 ms
70,872 KB
testcase_13 AC 75 ms
70,692 KB
testcase_14 AC 92 ms
78,208 KB
testcase_15 AC 92 ms
78,380 KB
testcase_16 AC 102 ms
83,236 KB
testcase_17 AC 98 ms
80,540 KB
testcase_18 AC 93 ms
79,756 KB
testcase_19 AC 168 ms
87,480 KB
testcase_20 AC 162 ms
85,928 KB
testcase_21 AC 99 ms
76,288 KB
testcase_22 AC 169 ms
87,296 KB
testcase_23 AC 154 ms
83,184 KB
testcase_24 AC 124 ms
92,496 KB
testcase_25 AC 127 ms
92,212 KB
testcase_26 AC 124 ms
92,524 KB
testcase_27 AC 122 ms
92,672 KB
testcase_28 AC 124 ms
92,424 KB
testcase_29 AC 202 ms
93,172 KB
testcase_30 AC 201 ms
93,176 KB
testcase_31 AC 199 ms
92,912 KB
testcase_32 AC 200 ms
93,068 KB
testcase_33 AC 200 ms
93,080 KB
testcase_34 AC 126 ms
92,676 KB
testcase_35 AC 74 ms
70,972 KB
testcase_36 AC 240 ms
92,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int, input().split())
A=list(map(int, input().split()))
ok,ng=0,10**15
while ng-ok>1:
  mid=(ok+ng)//2
  c=0
  base=0
  for j in range(N):
    a=base+A[j]
    if mid>a:
      cc=(mid-a-1)//(j+1)+1
      base+=cc*(j+1)
      c+=cc 
  if c>K:
    ng=mid 
  else:
    ok=mid 
print(ok)
0