結果

問題 No.116 門松列(1)
ユーザー あかりきあかりき
提出日時 2021-02-09 21:42:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 5,000 ms
コード長 197 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 71,520 KB
最終ジャッジ日時 2023-09-21 09:28:54
合計ジャッジ時間 3,131 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,328 KB
testcase_01 AC 68 ms
71,288 KB
testcase_02 AC 67 ms
71,148 KB
testcase_03 AC 68 ms
71,080 KB
testcase_04 AC 67 ms
71,420 KB
testcase_05 AC 68 ms
71,520 KB
testcase_06 AC 67 ms
71,220 KB
testcase_07 AC 68 ms
71,332 KB
testcase_08 AC 67 ms
71,464 KB
testcase_09 AC 68 ms
71,336 KB
testcase_10 AC 68 ms
71,224 KB
testcase_11 AC 68 ms
71,268 KB
testcase_12 AC 68 ms
71,340 KB
testcase_13 AC 68 ms
71,496 KB
testcase_14 AC 67 ms
71,116 KB
testcase_15 AC 67 ms
71,324 KB
testcase_16 AC 67 ms
71,400 KB
testcase_17 AC 67 ms
71,276 KB
testcase_18 AC 68 ms
71,136 KB
testcase_19 AC 67 ms
71,416 KB
testcase_20 AC 67 ms
71,504 KB
testcase_21 AC 67 ms
71,080 KB
testcase_22 AC 67 ms
71,284 KB
testcase_23 AC 73 ms
71,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
ct=0
for i in range(n-2):
  x=a[i];y=a[i+1];z=a[i+2]
  l=[x,y,z]
  l.sort()
  if x!=y and y!=z and z!=x and (l[1]==x or l[1]==z):
    ct+=1
print(ct)
0