結果

問題 No.116 門松列(1)
ユーザー gorugo30
提出日時 2021-02-22 21:42:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 5,000 ms
コード長 236 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 82,204 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2024-09-21 17:15:38
合計ジャッジ時間 2,076 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
ans = 0
A = list(map(int, input().split()))
for i in range(N - 2):
    a, b, c = A[i: i + 3]
    if a == b or b == c or c == a:
        continue
    if b == min(a, b, c) or b == max(a, b, c):
        ans += 1
print(ans)
0