結果
| 問題 | No.116 門松列(1) |
| コンテスト | |
| ユーザー |
koheijkt
|
| 提出日時 | 2025-08-03 21:37:31 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 63 ms / 5,000 ms |
| + 828µs | |
| コード長 | 242 bytes |
| 記録 | |
| コンパイル時間 | 233 ms |
| コンパイル使用メモリ | 95,852 KB |
| 実行使用メモリ | 79,104 KB |
| 最終ジャッジ日時 | 2026-07-13 19:36:04 |
| 合計ジャッジ時間 | 3,562 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(1, N - 1):
l, c, r = A[i - 1], A[i], A[i + 1]
if l != c and c != r and r != l:
if not (l < c < r) and not (l > c > r):
ans += 1
print(ans)
koheijkt