結果

問題 No.116 門松列(1)
ユーザー yuyyuyuyuyyuyu
提出日時 2015-08-04 15:53:49
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 79 ms / 5,000 ms
コード長 189 bytes
コンパイル時間 1,672 ms
コンパイル使用メモリ 77,380 KB
実行使用メモリ 76,588 KB
最終ジャッジ日時 2023-09-07 06:46:15
合計ジャッジ時間 4,079 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
76,500 KB
testcase_01 AC 78 ms
76,300 KB
testcase_02 AC 78 ms
76,144 KB
testcase_03 AC 79 ms
76,040 KB
testcase_04 AC 76 ms
76,352 KB
testcase_05 AC 76 ms
76,352 KB
testcase_06 AC 76 ms
76,292 KB
testcase_07 AC 78 ms
76,108 KB
testcase_08 AC 77 ms
76,320 KB
testcase_09 AC 77 ms
76,140 KB
testcase_10 AC 77 ms
76,336 KB
testcase_11 AC 78 ms
76,444 KB
testcase_12 AC 76 ms
76,032 KB
testcase_13 AC 77 ms
76,484 KB
testcase_14 AC 76 ms
76,312 KB
testcase_15 AC 77 ms
76,480 KB
testcase_16 AC 75 ms
76,480 KB
testcase_17 AC 78 ms
76,360 KB
testcase_18 AC 79 ms
76,244 KB
testcase_19 AC 76 ms
76,176 KB
testcase_20 AC 77 ms
76,588 KB
testcase_21 AC 76 ms
76,164 KB
testcase_22 AC 77 ms
76,112 KB
testcase_23 AC 76 ms
76,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(raw_input())
A=map(int,raw_input().split())
ans=0
for i in xrange(N-2):
    a,b,c=A[i],A[i+1],A[i+2]
    if (a!=b and b!=c and c!=a) and not (a<b<c or a>b>c):
        ans+=1
print ans
0