結果

問題 No.2648 [Cherry 6th Tune D] 一次元の馬
ユーザー nikoro256nikoro256
提出日時 2024-02-23 21:37:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 909 ms / 2,000 ms
コード長 436 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 145,180 KB
最終ジャッジ日時 2024-02-23 21:37:52
合計ジャッジ時間 8,524 ms
ジャッジサーバーID
(参考情報)
judge11 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 388 ms
78,196 KB
testcase_02 AC 136 ms
75,692 KB
testcase_03 AC 130 ms
75,692 KB
testcase_04 AC 139 ms
126,656 KB
testcase_05 AC 142 ms
126,880 KB
testcase_06 AC 139 ms
118,016 KB
testcase_07 AC 142 ms
143,144 KB
testcase_08 AC 128 ms
116,912 KB
testcase_09 AC 145 ms
123,784 KB
testcase_10 AC 142 ms
116,212 KB
testcase_11 AC 139 ms
139,464 KB
testcase_12 AC 144 ms
135,552 KB
testcase_13 AC 142 ms
143,504 KB
testcase_14 AC 157 ms
145,136 KB
testcase_15 AC 148 ms
145,140 KB
testcase_16 AC 151 ms
145,140 KB
testcase_17 AC 152 ms
145,140 KB
testcase_18 AC 158 ms
145,136 KB
testcase_19 AC 149 ms
145,136 KB
testcase_20 AC 148 ms
145,136 KB
testcase_21 AC 157 ms
145,140 KB
testcase_22 AC 149 ms
145,140 KB
testcase_23 AC 146 ms
145,136 KB
testcase_24 AC 150 ms
143,600 KB
testcase_25 AC 134 ms
107,224 KB
testcase_26 AC 150 ms
145,136 KB
testcase_27 AC 144 ms
127,964 KB
testcase_28 AC 153 ms
145,160 KB
testcase_29 AC 156 ms
143,344 KB
testcase_30 AC 152 ms
145,164 KB
testcase_31 AC 156 ms
145,160 KB
testcase_32 AC 151 ms
143,624 KB
testcase_33 AC 149 ms
145,180 KB
testcase_34 AC 150 ms
145,160 KB
testcase_35 AC 909 ms
78,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def nibun(f):
    left,right=-1,10**9
    while right-left>1:
        mid=(right+left)//2
        if f(mid):
            left=mid
        else:
            right=mid
    return right

def isok(n):
    B=[A[i]+i*n for i in range(N)]
    for i in range(N-1):
        if B[i]>=B[i+1]:
            return True
    return False

T=int(input())
for _ in range(T):
    N=int(input())
    A=list(map(int,input().split()))
    print(nibun(isok))
0