結果

問題 No.2648 [Cherry 6th Tune D] 一次元の馬
ユーザー playerplayer
提出日時 2024-02-25 00:45:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 433 ms / 2,000 ms
コード長 368 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 130,384 KB
最終ジャッジ日時 2024-02-25 00:45:13
合計ジャッジ時間 7,410 ms
ジャッジサーバーID
(参考情報)
judge14 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,460 KB
testcase_01 AC 173 ms
77,288 KB
testcase_02 AC 119 ms
76,604 KB
testcase_03 AC 119 ms
76,616 KB
testcase_04 AC 155 ms
114,868 KB
testcase_05 AC 147 ms
124,624 KB
testcase_06 AC 128 ms
117,344 KB
testcase_07 AC 130 ms
104,656 KB
testcase_08 AC 130 ms
115,544 KB
testcase_09 AC 144 ms
130,128 KB
testcase_10 AC 138 ms
126,124 KB
testcase_11 AC 132 ms
124,612 KB
testcase_12 AC 131 ms
125,232 KB
testcase_13 AC 132 ms
108,604 KB
testcase_14 AC 137 ms
130,256 KB
testcase_15 AC 138 ms
130,256 KB
testcase_16 AC 135 ms
130,384 KB
testcase_17 AC 138 ms
130,256 KB
testcase_18 AC 138 ms
130,384 KB
testcase_19 AC 136 ms
130,384 KB
testcase_20 AC 134 ms
130,380 KB
testcase_21 AC 135 ms
130,384 KB
testcase_22 AC 139 ms
130,256 KB
testcase_23 AC 137 ms
130,256 KB
testcase_24 AC 130 ms
130,228 KB
testcase_25 AC 118 ms
101,712 KB
testcase_26 AC 132 ms
130,380 KB
testcase_27 AC 126 ms
122,300 KB
testcase_28 AC 132 ms
130,280 KB
testcase_29 AC 125 ms
104,516 KB
testcase_30 AC 131 ms
130,280 KB
testcase_31 AC 132 ms
130,284 KB
testcase_32 AC 133 ms
130,284 KB
testcase_33 AC 133 ms
130,348 KB
testcase_34 AC 133 ms
130,280 KB
testcase_35 AC 433 ms
77,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *

t = int(input())

for _ in range(t):
    n = int(input())
    a = list(map(int, input().split()))
    d = defaultdict(int)
    for i in range(n):
        d[i] = a[i] # 初期座標
    ans = 0
    for i in range(n-1):
        if d[i] < d[i+1]:
            continue
        num = d[i] - d[i+1] + 1
        ans = max(ans,num)
    print(ans)   
0