結果

問題 No.2217 Suffix+
ユーザー flygonflygon
提出日時 2023-02-17 21:32:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 281 ms / 2,000 ms
コード長 558 bytes
コンパイル時間 382 ms
コンパイル使用メモリ 86,708 KB
実行使用メモリ 93,348 KB
最終ジャッジ日時 2023-09-26 18:41:43
合計ジャッジ時間 7,531 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
71,548 KB
testcase_01 AC 96 ms
71,592 KB
testcase_02 AC 93 ms
71,188 KB
testcase_03 AC 92 ms
71,640 KB
testcase_04 AC 94 ms
71,296 KB
testcase_05 AC 93 ms
71,240 KB
testcase_06 AC 94 ms
71,568 KB
testcase_07 AC 94 ms
71,476 KB
testcase_08 AC 96 ms
71,392 KB
testcase_09 AC 98 ms
71,156 KB
testcase_10 AC 97 ms
71,308 KB
testcase_11 AC 95 ms
71,508 KB
testcase_12 AC 95 ms
71,532 KB
testcase_13 AC 97 ms
71,536 KB
testcase_14 AC 117 ms
79,656 KB
testcase_15 AC 116 ms
79,520 KB
testcase_16 AC 126 ms
84,364 KB
testcase_17 AC 121 ms
81,692 KB
testcase_18 AC 123 ms
81,008 KB
testcase_19 AC 199 ms
88,808 KB
testcase_20 AC 193 ms
87,028 KB
testcase_21 AC 122 ms
77,464 KB
testcase_22 AC 199 ms
88,492 KB
testcase_23 AC 185 ms
84,456 KB
testcase_24 AC 147 ms
93,020 KB
testcase_25 AC 144 ms
93,000 KB
testcase_26 AC 145 ms
93,144 KB
testcase_27 AC 145 ms
92,888 KB
testcase_28 AC 148 ms
93,136 KB
testcase_29 AC 244 ms
92,908 KB
testcase_30 AC 246 ms
93,064 KB
testcase_31 AC 242 ms
93,348 KB
testcase_32 AC 249 ms
93,176 KB
testcase_33 AC 246 ms
93,196 KB
testcase_34 AC 147 ms
93,108 KB
testcase_35 AC 92 ms
71,488 KB
testcase_36 AC 281 ms
93,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd

n,k = map(int,input().split())
a =[0] + list(map(int,input().split()))

l = 0
r = 10**18
while r-l > 1:
  m = (r+l)//2
  cnt = 0
  now = 0
  for i in range(1, n+1):
    if a[i] + now < m:
      dif = m - (a[i] + now)
      tmp = (dif+i-1)//i
      cnt += tmp
      now += tmp * i
  if cnt <= k:
    l = m
  else:
    r = m
  
print(l)
0