結果

問題 No.2648 [Cherry 6th Tune D] 一次元の馬
ユーザー rlangevinrlangevin
提出日時 2024-02-23 21:30:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,027 ms / 2,000 ms
コード長 532 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 289,432 KB
最終ジャッジ日時 2024-04-17 13:14:16
合計ジャッジ時間 34,646 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
57,344 KB
testcase_01 AC 340 ms
77,952 KB
testcase_02 AC 245 ms
77,184 KB
testcase_03 AC 432 ms
77,696 KB
testcase_04 AC 800 ms
230,448 KB
testcase_05 AC 983 ms
284,900 KB
testcase_06 AC 707 ms
187,776 KB
testcase_07 AC 937 ms
267,528 KB
testcase_08 AC 707 ms
182,908 KB
testcase_09 AC 998 ms
289,432 KB
testcase_10 AC 979 ms
280,420 KB
testcase_11 AC 783 ms
220,444 KB
testcase_12 AC 913 ms
263,404 KB
testcase_13 AC 934 ms
267,532 KB
testcase_14 AC 1,002 ms
285,376 KB
testcase_15 AC 994 ms
285,240 KB
testcase_16 AC 1,004 ms
285,248 KB
testcase_17 AC 1,004 ms
285,116 KB
testcase_18 AC 999 ms
285,112 KB
testcase_19 AC 1,006 ms
285,496 KB
testcase_20 AC 992 ms
285,248 KB
testcase_21 AC 1,000 ms
285,240 KB
testcase_22 AC 1,005 ms
285,432 KB
testcase_23 AC 995 ms
285,376 KB
testcase_24 AC 1,027 ms
285,632 KB
testcase_25 AC 672 ms
163,868 KB
testcase_26 AC 1,020 ms
285,116 KB
testcase_27 AC 899 ms
265,196 KB
testcase_28 AC 1,022 ms
286,932 KB
testcase_29 AC 933 ms
270,300 KB
testcase_30 AC 1,009 ms
287,092 KB
testcase_31 AC 1,009 ms
286,676 KB
testcase_32 AC 1,005 ms
286,548 KB
testcase_33 AC 1,007 ms
285,260 KB
testcase_34 AC 1,001 ms
286,940 KB
testcase_35 AC 955 ms
86,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

def check(m, B):
    M = len(B)
    temp = [0] * M
    for i in range(M):
        temp[i] = B[i] + i * m
    for i in range(M - 1):
        if temp[i] >= temp[i + 1]:
            return False
    return True 

T = int(input())
for _ in range(T):
    N = int(input())
    A = list(map(int, input().split()))
    yes = 10 ** 18
    no = -1
    while yes - no != 1:
        mid = (yes + no)//2
        if check(mid, A):
            yes = mid
        else:
            no = mid
    print(yes)
    
0