結果

問題 No.3542 Progression (Python)
コンテスト
ユーザー tRue
提出日時 2026-05-06 23:40:51
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 168 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 218 ms
コンパイル使用メモリ 85,120 KB
実行使用メモリ 59,904 KB
スコア 420
最終ジャッジ日時 2026-05-16 15:05:28
合計ジャッジ時間 5,522 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n=int(input())
a=list(map(int,input().split()))
d=[a[i+1]-a[i] for i in range(n-1)]
s=c=2
for i in range(n-2):
 c=c+1 if d[i+1]==d[i] else 2
 s=max(s,c)
print(min(s,n))
0