結果

問題 No.2217 Suffix+
ユーザー titiatitia
提出日時 2023-02-17 22:25:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 387 bytes
コンパイル時間 360 ms
コンパイル使用メモリ 10,660 KB
実行使用メモリ 23,960 KB
最終ジャッジ日時 2023-09-26 19:41:45
合計ジャッジ時間 20,083 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,156 KB
testcase_01 AC 15 ms
7,832 KB
testcase_02 AC 16 ms
7,828 KB
testcase_03 AC 16 ms
7,752 KB
testcase_04 AC 15 ms
7,804 KB
testcase_05 AC 16 ms
7,788 KB
testcase_06 AC 16 ms
7,748 KB
testcase_07 AC 15 ms
7,892 KB
testcase_08 AC 16 ms
7,880 KB
testcase_09 AC 15 ms
7,752 KB
testcase_10 AC 16 ms
7,764 KB
testcase_11 AC 16 ms
7,760 KB
testcase_12 AC 16 ms
7,832 KB
testcase_13 AC 16 ms
7,804 KB
testcase_14 AC 282 ms
10,728 KB
testcase_15 AC 272 ms
10,832 KB
testcase_16 AC 553 ms
13,956 KB
testcase_17 AC 412 ms
12,296 KB
testcase_18 AC 329 ms
11,608 KB
testcase_19 AC 1,950 ms
16,768 KB
testcase_20 AC 1,929 ms
15,384 KB
testcase_21 AC 462 ms
9,112 KB
testcase_22 TLE -
testcase_23 AC 1,813 ms
14,028 KB
testcase_24 AC 976 ms
19,500 KB
testcase_25 AC 1,003 ms
19,504 KB
testcase_26 AC 989 ms
19,592 KB
testcase_27 AC 1,001 ms
19,452 KB
testcase_28 AC 996 ms
19,588 KB
testcase_29 TLE -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,K = map(int,input().split())
A = list(map(int,input().split()))

OK=0
NG=10**18

while NG>OK+1:
    mid=(OK+NG)//2
    c=0
    p=0

    for i in range(N):
        if A[i]+c<mid:
            u=mid-A[i]-c
            x=i+1

            k=(u+x-1)//x
            p+=k
            c+=k*x
    if p<=K:
        OK=mid
    else:
        NG=mid
print(OK)
0