結果

問題 No.1188 レベルX門松列
ユーザー 👑 rin204rin204
提出日時 2022-01-18 22:05:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 536 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 86,700 KB
実行使用メモリ 108,672 KB
最終ジャッジ日時 2023-08-15 07:40:24
合計ジャッジ時間 4,444 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
101,800 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 64 ms
71,132 KB
testcase_06 AC 99 ms
108,672 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 63 ms
71,136 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 66 ms
71,140 KB
testcase_21 AC 63 ms
70,880 KB
testcase_22 AC 64 ms
71,160 KB
testcase_23 AC 66 ms
71,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0