結果

問題 No.2217 Suffix+
ユーザー ニックネームニックネーム
提出日時 2023-02-17 21:36:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 230 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 417 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 129,964 KB
最終ジャッジ日時 2023-09-26 18:47:43
合計ジャッジ時間 6,408 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,312 KB
testcase_01 AC 69 ms
71,132 KB
testcase_02 AC 71 ms
71,212 KB
testcase_03 AC 74 ms
71,004 KB
testcase_04 AC 72 ms
71,208 KB
testcase_05 AC 72 ms
71,280 KB
testcase_06 AC 70 ms
71,176 KB
testcase_07 AC 70 ms
71,168 KB
testcase_08 AC 69 ms
71,228 KB
testcase_09 AC 70 ms
71,112 KB
testcase_10 AC 69 ms
71,232 KB
testcase_11 AC 71 ms
71,076 KB
testcase_12 AC 69 ms
71,180 KB
testcase_13 AC 70 ms
71,004 KB
testcase_14 AC 94 ms
84,984 KB
testcase_15 AC 89 ms
84,872 KB
testcase_16 AC 104 ms
96,384 KB
testcase_17 AC 95 ms
90,184 KB
testcase_18 AC 92 ms
87,632 KB
testcase_19 AC 151 ms
107,152 KB
testcase_20 AC 146 ms
102,044 KB
testcase_21 AC 90 ms
76,296 KB
testcase_22 AC 151 ms
105,776 KB
testcase_23 AC 136 ms
97,220 KB
testcase_24 AC 142 ms
128,672 KB
testcase_25 AC 143 ms
129,592 KB
testcase_26 AC 143 ms
129,620 KB
testcase_27 AC 144 ms
129,700 KB
testcase_28 AC 143 ms
128,732 KB
testcase_29 AC 206 ms
113,268 KB
testcase_30 AC 211 ms
114,364 KB
testcase_31 AC 208 ms
114,228 KB
testcase_32 AC 210 ms
114,152 KB
testcase_33 AC 209 ms
113,572 KB
testcase_34 AC 146 ms
129,964 KB
testcase_35 AC 68 ms
71,256 KB
testcase_36 AC 230 ms
107,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
a = list(map(int,input().split()))
ok = 0; ng = max(a)+k+1
while ng-ok>1:
    mid = (ok+ng)//2
    b = a[:]; c = s = 0
    for i in range(1,n+1):
        d = mid-a[i-1]-s
        if d<=0: continue
        r = (d-1+i)//i
        c += r; s += r*i
    if c<=k: ok = mid
    else: ng = mid
print(ok)
0