結果

問題 No.116 門松列(1)
コンテスト
ユーザー togatoga
提出日時 2015-08-19 09:59:16
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 220 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 154 ms
コンパイル使用メモリ 77,624 KB
最終ジャッジ日時 2025-12-03 16:19:13
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 4 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N = input()
A = map(int, raw_input().split())
res = 0
for i in range(N - 3):
    a = A[i]
    b = A[i + 1]
    c = A[i + 2]
    if (a == b or b == c):
        continue
    if (b < a or b > c):
        res += 1
print res
0