結果
| 問題 | No.116 門松列(1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-05-07 09:12:34 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 63 ms / 5,000 ms |
| + 395µs | |
| コード長 | 236 bytes |
| 記録 | |
| コンパイル時間 | 230 ms |
| コンパイル使用メモリ | 96,104 KB |
| 実行使用メモリ | 79,104 KB |
| 最終ジャッジ日時 | 2026-08-27 12:09:54 |
| 合計ジャッジ時間 | 3,522 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(len(A)-2):
l = A[i]
m = A[i+1]
r = A[i+2]
if (m > l and m > r and l != r) or (m < l and m < r and l != r):
ans += 1
print(ans)