結果

問題 No.116 門松列(1)
ユーザー 👑 yumechiyumechi
提出日時 2015-09-23 06:20:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 87 ms / 5,000 ms
コード長 225 bytes
コンパイル時間 340 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 71,468 KB
最終ジャッジ日時 2023-09-07 06:49:48
合計ジャッジ時間 3,546 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
71,288 KB
testcase_01 AC 86 ms
71,012 KB
testcase_02 AC 87 ms
71,352 KB
testcase_03 AC 85 ms
71,176 KB
testcase_04 AC 82 ms
71,352 KB
testcase_05 AC 79 ms
71,172 KB
testcase_06 AC 83 ms
71,264 KB
testcase_07 AC 79 ms
71,348 KB
testcase_08 AC 77 ms
71,308 KB
testcase_09 AC 81 ms
71,468 KB
testcase_10 AC 82 ms
71,396 KB
testcase_11 AC 82 ms
71,288 KB
testcase_12 AC 83 ms
71,132 KB
testcase_13 AC 77 ms
71,356 KB
testcase_14 AC 82 ms
71,432 KB
testcase_15 AC 83 ms
71,008 KB
testcase_16 AC 81 ms
71,288 KB
testcase_17 AC 80 ms
71,304 KB
testcase_18 AC 79 ms
71,292 KB
testcase_19 AC 80 ms
71,296 KB
testcase_20 AC 79 ms
71,368 KB
testcase_21 AC 84 ms
71,172 KB
testcase_22 AC 86 ms
71,264 KB
testcase_23 AC 82 ms
71,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ali = list(map(int, input().split()))
res = 0
for i in range(n-2):
    cli = list(set(ali[i:i+3]))
    cli.sort()
    if len(cli) == 3 and (ali[i] == cli[1] or ali[i+2] == cli[1]):
        res += 1
print(res)
0