結果

問題 No.116 門松列(1)
ユーザー ohana
提出日時 2023-10-20 11:37:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 225 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 82,268 KB
実行使用メモリ 53,780 KB
最終ジャッジ日時 2024-09-20 07:09:56
合計ジャッジ時間 1,931 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 13 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))

cnt = 0
for i in range(n - 2):
    a, b, c = A[i : i + 3]
    B = sorted(A[i : i + 3])
    if a != b and b != c and (a == B[1] or c == B[1]):
        cnt += 1

print(cnt)
0