結果

問題 No.2648 [Cherry 6th Tune D] 一次元の馬
ユーザー hibit_athibit_at
提出日時 2024-02-23 21:40:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 657 ms / 2,000 ms
コード長 538 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 100,384 KB
最終ジャッジ日時 2024-02-23 21:40:42
合計ジャッジ時間 18,716 ms
ジャッジサーバーID
(参考情報)
judge16 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
59,336 KB
testcase_01 AC 449 ms
77,008 KB
testcase_02 AC 310 ms
75,740 KB
testcase_03 AC 492 ms
75,904 KB
testcase_04 AC 529 ms
87,276 KB
testcase_05 AC 474 ms
97,772 KB
testcase_06 AC 438 ms
83,472 KB
testcase_07 AC 461 ms
95,328 KB
testcase_08 AC 440 ms
85,044 KB
testcase_09 AC 475 ms
99,948 KB
testcase_10 AC 617 ms
97,900 KB
testcase_11 AC 445 ms
86,376 KB
testcase_12 AC 471 ms
93,696 KB
testcase_13 AC 470 ms
95,304 KB
testcase_14 AC 465 ms
100,376 KB
testcase_15 AC 472 ms
100,372 KB
testcase_16 AC 491 ms
100,372 KB
testcase_17 AC 470 ms
100,364 KB
testcase_18 AC 481 ms
100,364 KB
testcase_19 AC 469 ms
100,356 KB
testcase_20 AC 467 ms
100,372 KB
testcase_21 AC 657 ms
100,244 KB
testcase_22 AC 482 ms
100,364 KB
testcase_23 AC 507 ms
100,372 KB
testcase_24 AC 423 ms
100,244 KB
testcase_25 AC 360 ms
82,800 KB
testcase_26 AC 443 ms
100,240 KB
testcase_27 AC 394 ms
90,504 KB
testcase_28 AC 445 ms
100,384 KB
testcase_29 AC 407 ms
97,008 KB
testcase_30 AC 465 ms
100,384 KB
testcase_31 AC 463 ms
100,380 KB
testcase_32 AC 446 ms
100,380 KB
testcase_33 AC 441 ms
100,196 KB
testcase_34 AC 480 ms
100,384 KB
testcase_35 AC 435 ms
77,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left

def solve():
    n = int(input())
    a = list(map(int, input().split(' ')))
    # print(n,a)
    ans = 0
    for i in range(n-1):
        ng = -1
        ok = int(1e18)
        while abs(ng-ok) > 1:
            mid = ng+ok
            mid //= 2
            if a[i] + (i+1)*mid < a[i+1] + (i+2)*mid:
                ok = mid
            else:
                ng = mid
        # print('ok',ok)
        ans = max(ans,ok)
    # print(ans)
    return ans

t = int(input())
for _ in range(t):
    print(solve())
0