結果

問題 No.2217 Suffix+
ユーザー lllllll88938494lllllll88938494
提出日時 2023-03-30 21:44:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 521 bytes
コンパイル時間 553 ms
コンパイル使用メモリ 11,744 KB
実行使用メモリ 21,520 KB
最終ジャッジ日時 2023-10-22 05:42:41
合計ジャッジ時間 21,871 ms
ジャッジサーバーID
(参考情報)
judge13 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,044 KB
testcase_01 AC 29 ms
10,044 KB
testcase_02 AC 30 ms
10,044 KB
testcase_03 AC 29 ms
10,044 KB
testcase_04 AC 30 ms
10,044 KB
testcase_05 AC 30 ms
10,044 KB
testcase_06 AC 29 ms
10,044 KB
testcase_07 AC 31 ms
10,044 KB
testcase_08 AC 31 ms
10,044 KB
testcase_09 AC 30 ms
10,044 KB
testcase_10 AC 29 ms
10,044 KB
testcase_11 AC 30 ms
10,044 KB
testcase_12 AC 30 ms
10,044 KB
testcase_13 AC 30 ms
10,044 KB
testcase_14 AC 151 ms
12,916 KB
testcase_15 AC 153 ms
12,632 KB
testcase_16 AC 281 ms
16,012 KB
testcase_17 AC 208 ms
14,216 KB
testcase_18 AC 176 ms
13,500 KB
testcase_19 AC 890 ms
18,724 KB
testcase_20 AC 860 ms
17,484 KB
testcase_21 AC 229 ms
11,168 KB
testcase_22 AC 890 ms
18,212 KB
testcase_23 AC 788 ms
16,080 KB
testcase_24 AC 484 ms
21,520 KB
testcase_25 AC 489 ms
21,520 KB
testcase_26 AC 492 ms
21,520 KB
testcase_27 AC 492 ms
21,520 KB
testcase_28 AC 494 ms
21,520 KB
testcase_29 AC 1,747 ms
21,520 KB
testcase_30 AC 1,743 ms
21,520 KB
testcase_31 AC 1,739 ms
21,520 KB
testcase_32 AC 1,711 ms
21,520 KB
testcase_33 AC 1,747 ms
21,520 KB
testcase_34 AC 502 ms
20,768 KB
testcase_35 AC 30 ms
10,044 KB
testcase_36 TLE -
権限があれば一括ダウンロードができます

ソースコード

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