結果

問題 No.2217 Suffix+
ユーザー ああいいああいい
提出日時 2023-02-18 17:34:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 205 ms / 2,000 ms
コード長 490 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 92,992 KB
最終ジャッジ日時 2023-09-27 08:42:22
合計ジャッジ時間 5,823 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,144 KB
testcase_01 AC 69 ms
71,364 KB
testcase_02 AC 70 ms
71,176 KB
testcase_03 AC 72 ms
71,208 KB
testcase_04 AC 71 ms
71,104 KB
testcase_05 AC 70 ms
70,948 KB
testcase_06 AC 71 ms
71,148 KB
testcase_07 AC 69 ms
70,948 KB
testcase_08 AC 71 ms
71,100 KB
testcase_09 AC 70 ms
71,156 KB
testcase_10 AC 70 ms
71,456 KB
testcase_11 AC 71 ms
71,152 KB
testcase_12 AC 73 ms
71,136 KB
testcase_13 AC 72 ms
71,172 KB
testcase_14 AC 82 ms
78,328 KB
testcase_15 AC 82 ms
78,436 KB
testcase_16 AC 90 ms
83,364 KB
testcase_17 AC 85 ms
80,708 KB
testcase_18 AC 83 ms
79,636 KB
testcase_19 AC 121 ms
87,612 KB
testcase_20 AC 116 ms
85,840 KB
testcase_21 AC 86 ms
76,248 KB
testcase_22 AC 121 ms
87,600 KB
testcase_23 AC 114 ms
83,480 KB
testcase_24 AC 106 ms
92,840 KB
testcase_25 AC 103 ms
92,472 KB
testcase_26 AC 101 ms
92,544 KB
testcase_27 AC 105 ms
92,764 KB
testcase_28 AC 105 ms
92,708 KB
testcase_29 AC 184 ms
92,676 KB
testcase_30 AC 182 ms
92,968 KB
testcase_31 AC 183 ms
92,988 KB
testcase_32 AC 182 ms
92,968 KB
testcase_33 AC 183 ms
92,896 KB
testcase_34 AC 105 ms
92,880 KB
testcase_35 AC 69 ms
71,124 KB
testcase_36 AC 205 ms
92,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
A = list(map(int,input().split()))

end = 10 ** 15
start = 0

def calc(mid):
    n = 0
    now = 0
    for i in range(N):
        a = A[i]
        if a + now < mid:
            u = (mid - a - now + i) // (i + 1)
            n += u
            now += u * (i + 1)
            if n > K:return False
    return True
            

while end - start > 1:
    mid = end + start >> 1
    if not calc(mid):
        end = mid
    else:
        start = mid
print(start)
0