結果
問題 |
No.2648 [Cherry 6th Tune D] 一次元の馬
|
ユーザー |
![]() |
提出日時 | 2024-02-25 00:45:04 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 436 ms / 2,000 ms |
コード長 | 368 bytes |
コンパイル時間 | 237 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 131,212 KB |
最終ジャッジ日時 | 2025-06-20 02:04:42 |
合計ジャッジ時間 | 7,649 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 38 |
ソースコード
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)