結果

問題 No.1188 レベルX門松列
ユーザー 👑 rin204rin204
提出日時 2022-01-18 22:06:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 516 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 87,232 KB
実行使用メモリ 102,316 KB
最終ジャッジ日時 2023-08-15 07:40:33
合計ジャッジ時間 3,592 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
101,616 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 65 ms
71,164 KB
testcase_06 AC 100 ms
101,084 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 64 ms
70,880 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 62 ms
71,140 KB
testcase_21 AC 62 ms
71,232 KB
testcase_22 AC 64 ms
70,740 KB
testcase_23 AC 63 ms
70,960 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
        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