結果

問題 No.116 門松列(1)
ユーザー panapanagdfpanapanagdf
提出日時 2019-09-20 15:05:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 178 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 10,616 KB
実行使用メモリ 8,000 KB
最終ジャッジ日時 2023-10-12 05:41:58
合計ジャッジ時間 1,913 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,824 KB
testcase_01 AC 16 ms
7,732 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 15 ms
7,948 KB
testcase_05 AC 16 ms
7,952 KB
testcase_06 WA -
testcase_07 AC 16 ms
7,860 KB
testcase_08 AC 16 ms
7,860 KB
testcase_09 AC 17 ms
7,860 KB
testcase_10 WA -
testcase_11 AC 16 ms
7,844 KB
testcase_12 WA -
testcase_13 AC 16 ms
7,860 KB
testcase_14 AC 16 ms
7,764 KB
testcase_15 WA -
testcase_16 AC 16 ms
7,880 KB
testcase_17 AC 16 ms
7,824 KB
testcase_18 WA -
testcase_19 AC 17 ms
7,864 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 16 ms
7,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


a=int(input())
b=[int(i) for i in input().split()]
c=0
for i in range(2,a):
    if (b[i-1]>b[i]) and (b[i-1]>b[i-2]) or (b[i-1]<b[i]) and (b[i-1]<b[i-2]):
        c+=1
print(c)
0