結果

問題 No.2648 [Cherry 6th Tune D] 一次元の馬
ユーザー titiatitia
提出日時 2024-02-23 21:28:39
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 358 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 32,900 KB
最終ジャッジ日時 2024-09-29 05:31:27
合計ジャッジ時間 8,579 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

T=int(input())
for tests in range(T):
    N=int(input())
    A=list(map(int,input().split()))

    ANS=0

    for i in range(1,N):
        if A[i]-A[i-1]<=0:
            ANS=max(ANS,A[i-1]-A[i]+1)

    print(ANS)
0