結果

問題 No.2217 Suffix+
ユーザー tassei903tassei903
提出日時 2023-02-17 21:35:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,679 ms / 2,000 ms
コード長 664 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 86,840 KB
実行使用メモリ 93,252 KB
最終ジャッジ日時 2023-09-26 18:45:55
合計ジャッジ時間 19,153 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,272 KB
testcase_01 AC 69 ms
71,008 KB
testcase_02 AC 71 ms
71,140 KB
testcase_03 AC 71 ms
71,316 KB
testcase_04 AC 71 ms
71,092 KB
testcase_05 AC 71 ms
71,256 KB
testcase_06 AC 69 ms
71,120 KB
testcase_07 AC 69 ms
71,380 KB
testcase_08 AC 71 ms
71,276 KB
testcase_09 AC 73 ms
71,092 KB
testcase_10 AC 70 ms
71,156 KB
testcase_11 AC 70 ms
71,112 KB
testcase_12 AC 70 ms
71,092 KB
testcase_13 AC 72 ms
71,076 KB
testcase_14 AC 172 ms
78,980 KB
testcase_15 AC 175 ms
79,048 KB
testcase_16 AC 268 ms
83,808 KB
testcase_17 AC 221 ms
81,376 KB
testcase_18 AC 201 ms
80,424 KB
testcase_19 AC 783 ms
88,008 KB
testcase_20 AC 763 ms
86,304 KB
testcase_21 AC 243 ms
77,020 KB
testcase_22 AC 770 ms
87,720 KB
testcase_23 AC 702 ms
83,732 KB
testcase_24 AC 431 ms
92,808 KB
testcase_25 AC 423 ms
92,568 KB
testcase_26 AC 421 ms
92,520 KB
testcase_27 AC 429 ms
92,660 KB
testcase_28 AC 436 ms
92,536 KB
testcase_29 AC 1,341 ms
93,140 KB
testcase_30 AC 1,346 ms
92,912 KB
testcase_31 AC 1,330 ms
92,988 KB
testcase_32 AC 1,327 ms
93,096 KB
testcase_33 AC 1,346 ms
92,968 KB
testcase_34 AC 1,106 ms
93,252 KB
testcase_35 AC 71 ms
71,136 KB
testcase_36 AC 1,679 ms
93,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################

n,k = na()
a = na()
ok = 0
ng = 10**20

while abs(ok - ng)>1:
    d = ok+ng>>1
    s = 0
    res = 0
    for i in range(n):
        x = d - s - a[i]
        if x >= 0:
            s += (x + i)//(i+1) * (i+1)
            res += (x + i)//(i+1)
    if res <= k:
        ok = d
    else:
        ng = d

print(ok)
0