結果

問題 No.2217 Suffix+
ユーザー lllllll88938494lllllll88938494
提出日時 2023-03-30 21:45:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 265 ms / 2,000 ms
コード長 521 bytes
コンパイル時間 1,831 ms
コンパイル使用メモリ 79,492 KB
実行使用メモリ 91,204 KB
最終ジャッジ日時 2023-10-22 05:42:53
合計ジャッジ時間 6,434 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
51,664 KB
testcase_01 AC 35 ms
51,644 KB
testcase_02 AC 35 ms
51,760 KB
testcase_03 AC 34 ms
51,632 KB
testcase_04 AC 36 ms
51,636 KB
testcase_05 AC 36 ms
51,648 KB
testcase_06 AC 35 ms
51,640 KB
testcase_07 AC 35 ms
51,652 KB
testcase_08 AC 35 ms
51,652 KB
testcase_09 AC 35 ms
51,648 KB
testcase_10 AC 35 ms
51,640 KB
testcase_11 AC 35 ms
51,652 KB
testcase_12 AC 36 ms
51,636 KB
testcase_13 AC 35 ms
51,636 KB
testcase_14 AC 48 ms
65,516 KB
testcase_15 AC 51 ms
66,512 KB
testcase_16 AC 57 ms
72,404 KB
testcase_17 AC 56 ms
69,528 KB
testcase_18 AC 52 ms
67,840 KB
testcase_19 AC 141 ms
83,196 KB
testcase_20 AC 138 ms
79,508 KB
testcase_21 AC 66 ms
64,480 KB
testcase_22 AC 141 ms
80,848 KB
testcase_23 AC 128 ms
76,132 KB
testcase_24 AC 76 ms
86,972 KB
testcase_25 AC 75 ms
86,292 KB
testcase_26 AC 76 ms
86,768 KB
testcase_27 AC 75 ms
86,948 KB
testcase_28 AC 76 ms
87,008 KB
testcase_29 AC 202 ms
91,140 KB
testcase_30 AC 201 ms
91,136 KB
testcase_31 AC 216 ms
91,136 KB
testcase_32 AC 197 ms
91,132 KB
testcase_33 AC 201 ms
91,148 KB
testcase_34 AC 74 ms
86,696 KB
testcase_35 AC 35 ms
51,632 KB
testcase_36 AC 265 ms
91,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def  cal(x):
    cnt = 0
    now = 0
    for i in range(n):
        if now + a[i] < x:
            t=now + a[i]
            v,m=divmod(x-t,i+1)
            if m>0:
                v+=1
            cnt += v
            now += v * (i+1)

    # print(cnt,x)
    if cnt <= k:
        return True
    else:
        return False

ok = 0
ng = 10 ** 15
while ng - ok > 1:

    mid = (ng+ok)//2
    if cal(mid):
        ok = mid
    else:
        ng = mid

print(ok)
0