結果

問題 No.2648 [Cherry 6th Tune D] 一次元の馬
ユーザー NakLon131
提出日時 2024-02-23 22:29:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 683 ms / 2,000 ms
コード長 493 bytes
コンパイル時間 377 ms
コンパイル使用メモリ 82,260 KB
実行使用メモリ 259,060 KB
最終ジャッジ日時 2024-09-29 07:26:54
合計ジャッジ時間 12,888 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

def isok(x, a) -> bool:
    aa = []
    for i in range(len(a)):
        aa.append(a[i] + x * (i+1)) 
    
    for i in range(1, len(aa)):
        if aa[i-1] >= aa[i]:
            return False
    return True   

t = int(input())
for i in range(t):
    n = int(input())
    a = list(map(int, input().split()))
    
    ng = -1
    ok = 1 << 30
    for _ in range(30):
        md = (ng + ok) // 2
        if isok(md, a):
            ok = md
        else:
            ng = md
    print(ok)
    

0