結果

問題 No.116 門松列(1)
ユーザー first_vilfirst_vil
提出日時 2020-07-29 09:59:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 174 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 10,680 KB
実行使用メモリ 7,992 KB
最終ジャッジ日時 2023-09-11 07:10:08
合計ジャッジ時間 1,771 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n-2):
    b=sorted(a[i:i+3])
    if b[0]!=b[1] and b[1]!=b[2] and a[i+2]==b[1]:
        ans+=1
print(ans)
0