結果

問題 No.2648 [Cherry 6th Tune D] 一次元の馬
ユーザー 👑 tipstar0125tipstar0125
提出日時 2024-02-23 21:50:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 992 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 295,180 KB
最終ジャッジ日時 2024-02-23 21:50:57
合計ジャッジ時間 32,275 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 373 ms
76,388 KB
testcase_02 AC 398 ms
78,516 KB
testcase_03 AC 397 ms
77,772 KB
testcase_04 AC 834 ms
261,216 KB
testcase_05 AC 860 ms
291,408 KB
testcase_06 AC 747 ms
227,728 KB
testcase_07 AC 853 ms
293,400 KB
testcase_08 AC 750 ms
214,324 KB
testcase_09 AC 881 ms
283,496 KB
testcase_10 AC 863 ms
285,112 KB
testcase_11 AC 773 ms
257,740 KB
testcase_12 AC 892 ms
295,180 KB
testcase_13 AC 870 ms
288,932 KB
testcase_14 AC 902 ms
283,052 KB
testcase_15 AC 871 ms
282,932 KB
testcase_16 AC 922 ms
283,052 KB
testcase_17 AC 909 ms
283,056 KB
testcase_18 AC 890 ms
283,056 KB
testcase_19 AC 912 ms
283,052 KB
testcase_20 AC 867 ms
282,928 KB
testcase_21 AC 916 ms
283,052 KB
testcase_22 AC 905 ms
283,060 KB
testcase_23 AC 854 ms
283,052 KB
testcase_24 AC 985 ms
283,056 KB
testcase_25 AC 677 ms
194,488 KB
testcase_26 AC 916 ms
283,052 KB
testcase_27 AC 872 ms
290,536 KB
testcase_28 AC 992 ms
282,228 KB
testcase_29 AC 950 ms
293,212 KB
testcase_30 AC 946 ms
282,172 KB
testcase_31 AC 966 ms
282,172 KB
testcase_32 AC 924 ms
282,172 KB
testcase_33 AC 955 ms
280,476 KB
testcase_34 AC 938 ms
282,172 KB
testcase_35 AC 930 ms
77,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
for _ in range(T):
    N=int(input())
    A=list(map(int,input().split()))
    ng=-1
    ok=int(1e18)
    
    def f(x):
        B=[A[0]+x]
        for i in range(1,N):
            b=A[i]+(i+1)*x
            if B[-1]>=b:return False
            B.append(b)
        return True

    while ok-ng>1:
        m=(ok+ng)//2
        if f(m):ok=m
        else:ng=m
    print(ok)
0