結果

問題 No.116 門松列(1)
ユーザー liny_tailliny_tail
提出日時 2020-06-20 12:24:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 19 ms / 5,000 ms
コード長 247 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 8,568 KB
最終ジャッジ日時 2023-09-16 17:10:08
合計ジャッジ時間 1,703 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,512 KB
testcase_01 AC 18 ms
8,464 KB
testcase_02 AC 18 ms
8,480 KB
testcase_03 AC 18 ms
8,436 KB
testcase_04 AC 18 ms
8,556 KB
testcase_05 AC 18 ms
8,568 KB
testcase_06 AC 18 ms
8,464 KB
testcase_07 AC 18 ms
8,436 KB
testcase_08 AC 18 ms
8,524 KB
testcase_09 AC 18 ms
8,548 KB
testcase_10 AC 19 ms
8,436 KB
testcase_11 AC 18 ms
8,412 KB
testcase_12 AC 19 ms
8,472 KB
testcase_13 AC 19 ms
8,540 KB
testcase_14 AC 19 ms
8,556 KB
testcase_15 AC 19 ms
8,480 KB
testcase_16 AC 19 ms
8,472 KB
testcase_17 AC 19 ms
8,524 KB
testcase_18 AC 18 ms
8,524 KB
testcase_19 AC 18 ms
8,484 KB
testcase_20 AC 18 ms
8,440 KB
testcase_21 AC 18 ms
8,440 KB
testcase_22 AC 18 ms
8,548 KB
testcase_23 AC 18 ms
8,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

tmp = input()
N = [int(i) for i in input().strip().split(' ')]

c = 0

for i in range(len(N) - 2):
  d = sorted(N[i:i+3])[1]
  if N[i+1] != d:
    if len(collections.Counter(N[i:i+3])) == 3:
      c += 1

print('{}'.format(c))
0