結果
問題 | No.116 門松列(1) |
ユーザー |
|
提出日時 | 2021-05-07 09:12:34 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 41 ms / 5,000 ms |
コード長 | 236 bytes |
コンパイル時間 | 450 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 52,096 KB |
最終ジャッジ日時 | 2024-09-14 22:16:05 |
合計ジャッジ時間 | 2,339 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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)