結果

問題 No.2217 Suffix+
ユーザー 310icecrystal310icecrystal
提出日時 2023-06-09 20:52:47
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 429 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 94,328 KB
最終ジャッジ日時 2023-08-30 12:25:54
合計ジャッジ時間 24,512 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,264 KB
testcase_01 AC 74 ms
71,500 KB
testcase_02 AC 75 ms
71,512 KB
testcase_03 AC 73 ms
71,360 KB
testcase_04 AC 73 ms
71,320 KB
testcase_05 AC 73 ms
71,400 KB
testcase_06 AC 72 ms
71,256 KB
testcase_07 AC 73 ms
71,172 KB
testcase_08 AC 73 ms
71,052 KB
testcase_09 AC 74 ms
71,328 KB
testcase_10 AC 74 ms
71,424 KB
testcase_11 AC 70 ms
71,396 KB
testcase_12 AC 72 ms
71,356 KB
testcase_13 AC 71 ms
71,268 KB
testcase_14 AC 178 ms
79,552 KB
testcase_15 AC 180 ms
79,524 KB
testcase_16 AC 280 ms
84,504 KB
testcase_17 AC 229 ms
81,888 KB
testcase_18 AC 202 ms
81,004 KB
testcase_19 AC 944 ms
88,504 KB
testcase_20 AC 910 ms
87,020 KB
testcase_21 AC 300 ms
77,304 KB
testcase_22 AC 934 ms
88,460 KB
testcase_23 AC 860 ms
84,328 KB
testcase_24 AC 456 ms
93,728 KB
testcase_25 AC 447 ms
93,700 KB
testcase_26 AC 448 ms
93,676 KB
testcase_27 AC 447 ms
93,800 KB
testcase_28 AC 451 ms
93,800 KB
testcase_29 AC 1,968 ms
94,288 KB
testcase_30 AC 1,969 ms
94,292 KB
testcase_31 AC 1,977 ms
94,096 KB
testcase_32 AC 1,964 ms
94,328 KB
testcase_33 AC 1,962 ms
94,168 KB
testcase_34 AC 444 ms
94,192 KB
testcase_35 AC 75 ms
71,264 KB
testcase_36 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
A = [-1] + list(map(int,input().split()))

OK = 0
NG = 10**28 + 1
while NG - OK >= 2:
    MID = (OK + NG) // 2
    count = 0
    now_plus = 0
    for i in range(1,N+1):
        if A[i] + now_plus < MID:
            k = -(-(MID - A[i] - now_plus) // i)
            count += k
            now_plus += i * k
    #print(MID,count)
    if count > K:
        NG = MID
    else:
        OK = MID
print(OK)
0