結果

問題 No.2217 Suffix+
ユーザー hiryuNhiryuN
提出日時 2023-02-17 22:41:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 194 ms / 2,000 ms
コード長 414 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 86,940 KB
実行使用メモリ 92,948 KB
最終ジャッジ日時 2023-09-26 19:59:48
合計ジャッジ時間 5,667 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,188 KB
testcase_01 AC 70 ms
71,184 KB
testcase_02 AC 69 ms
71,136 KB
testcase_03 AC 70 ms
71,344 KB
testcase_04 AC 74 ms
71,232 KB
testcase_05 AC 76 ms
71,232 KB
testcase_06 AC 71 ms
71,016 KB
testcase_07 AC 71 ms
71,212 KB
testcase_08 AC 69 ms
71,184 KB
testcase_09 AC 70 ms
71,128 KB
testcase_10 AC 70 ms
71,324 KB
testcase_11 AC 70 ms
71,184 KB
testcase_12 AC 70 ms
71,216 KB
testcase_13 AC 74 ms
71,056 KB
testcase_14 AC 79 ms
77,980 KB
testcase_15 AC 80 ms
78,300 KB
testcase_16 AC 88 ms
82,948 KB
testcase_17 AC 84 ms
80,344 KB
testcase_18 AC 84 ms
79,420 KB
testcase_19 AC 120 ms
87,292 KB
testcase_20 AC 111 ms
85,628 KB
testcase_21 AC 82 ms
76,104 KB
testcase_22 AC 116 ms
87,368 KB
testcase_23 AC 106 ms
83,108 KB
testcase_24 AC 102 ms
92,404 KB
testcase_25 AC 103 ms
92,392 KB
testcase_26 AC 102 ms
92,384 KB
testcase_27 AC 101 ms
92,372 KB
testcase_28 AC 101 ms
92,496 KB
testcase_29 AC 173 ms
92,824 KB
testcase_30 AC 173 ms
92,744 KB
testcase_31 AC 173 ms
92,788 KB
testcase_32 AC 175 ms
92,948 KB
testcase_33 AC 175 ms
92,704 KB
testcase_34 AC 99 ms
92,788 KB
testcase_35 AC 71 ms
71,304 KB
testcase_36 AC 194 ms
92,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
A=list(map(int,input().split()))
ans=0
def make(ans):
    pre=0
    key=k
    for q in range(n):
        if pre+A[q]<ans:
            div=-(-(ans-pre-A[q])//(q+1))
            key-=div
            pre+=div*(q+1)
            if key<0:
                return 0
    return 1
for i in range(50,-1,-1):
    ans+=2**i
    if not make(ans):
        ans-=2**i
print(ans)
    
        
        
0