結果

問題 No.116 門松列(1)
ユーザー rpy3cpprpy3cpp
提出日時 2015-07-12 22:13:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 8,016 KB
最終ジャッジ日時 2023-09-22 14:33:02
合計ジャッジ時間 1,695 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

N = int(input())
As = list(map(int, input().split()))

def solve(N, As):
    count = 0
    for a, b, c in zip(As[:], As[1:], As[2:]):
        count += is_kadomatsu(a, b, c)
    return count

def is_kadomatsu(a, b, c):
    if a == b == c:
        return False
    return max(a, b, c) == b or min(a, b, c) == b

print(solve(N, As))
0