結果

問題 No.2217 Suffix+
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-02-17 21:59:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 964 ms / 2,000 ms
コード長 457 bytes
コンパイル時間 438 ms
コンパイル使用メモリ 86,736 KB
実行使用メモリ 92,976 KB
最終ジャッジ日時 2023-09-26 19:16:54
合計ジャッジ時間 11,105 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,244 KB
testcase_01 AC 69 ms
71,272 KB
testcase_02 AC 69 ms
71,272 KB
testcase_03 AC 67 ms
71,036 KB
testcase_04 AC 69 ms
70,996 KB
testcase_05 AC 68 ms
70,888 KB
testcase_06 AC 68 ms
70,908 KB
testcase_07 AC 69 ms
71,052 KB
testcase_08 AC 69 ms
71,052 KB
testcase_09 AC 68 ms
71,116 KB
testcase_10 AC 68 ms
71,112 KB
testcase_11 AC 68 ms
71,108 KB
testcase_12 AC 67 ms
70,924 KB
testcase_13 AC 67 ms
71,240 KB
testcase_14 AC 91 ms
78,536 KB
testcase_15 AC 97 ms
78,664 KB
testcase_16 AC 108 ms
83,092 KB
testcase_17 AC 105 ms
80,764 KB
testcase_18 AC 104 ms
79,852 KB
testcase_19 AC 314 ms
87,488 KB
testcase_20 AC 294 ms
85,704 KB
testcase_21 AC 133 ms
76,724 KB
testcase_22 AC 290 ms
87,432 KB
testcase_23 AC 265 ms
83,656 KB
testcase_24 AC 214 ms
92,568 KB
testcase_25 AC 198 ms
92,352 KB
testcase_26 AC 179 ms
92,500 KB
testcase_27 AC 181 ms
92,564 KB
testcase_28 AC 198 ms
92,384 KB
testcase_29 AC 778 ms
92,820 KB
testcase_30 AC 777 ms
92,828 KB
testcase_31 AC 763 ms
92,952 KB
testcase_32 AC 761 ms
92,824 KB
testcase_33 AC 774 ms
92,756 KB
testcase_34 AC 204 ms
92,732 KB
testcase_35 AC 68 ms
71,096 KB
testcase_36 AC 964 ms
92,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
A = list(map(int,input().split()))


def calc(x):
    count = 0
    left = k
    for i,a in enumerate(A,1):
        na = a+count
        if na >= x:
            continue
        need = (x-na+i-1)//i
        if need > left:
            return False
        count += need*i
        left -= need

    return True



l = 0
r = 10**20
while r > l + 1:
    m = (r+l)//2
    if calc(m):
        l = m
    else:
        r = m
print(l)
0