結果
| 問題 |
No.1188 レベルX門松列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-18 22:05:02 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 536 bytes |
| コンパイル時間 | 214 ms |
| コンパイル使用メモリ | 82,616 KB |
| 実行使用メモリ | 100,992 KB |
| 最終ジャッジ日時 | 2024-11-23 13:31:46 |
| 合計ジャッジ時間 | 3,300 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 WA * 16 |
ソースコード
n = int(input())
A = list(map(int, input().split()))
S = []
for i in range(1, n):
if A[i - 1] > A[i]:
S.append(">")
elif A[i - 1] == A[i]:
S.append("=")
else:
S.append("<")
T = []
cnt = 0
bef = ""
for s in S:
if s == "=":
T.append(cnt)
cnt = 0
T.append(0)
bef = s
elif s == bef:
cnt += 1
else:
T.append(cnt)
cnt = 1
bef = s
T.append(cnt)
ans = 0
for i in range(1, len(T)):
ans = max(ans, min(T[i], T[i - 1]))
print(ans)