結果
問題 |
No.116 門松列(1)
|
ユーザー |
|
提出日時 | 2015-07-12 22:13:36 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 329 bytes |
コンパイル時間 | 127 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-08 06:08:45 |
合計ジャッジ時間 | 1,641 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 11 WA * 10 |
ソースコード
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))