結果
| 問題 |
No.116 門松列(1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-03 18:57:46 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 5,000 ms |
| コード長 | 218 bytes |
| コンパイル時間 | 206 ms |
| コンパイル使用メモリ | 82,308 KB |
| 実行使用メモリ | 52,480 KB |
| 最終ジャッジ日時 | 2024-11-21 20:18:12 |
| 合計ジャッジ時間 | 2,063 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
N = int(input())
A = list(map(int, input().split()))
cnt = 0
for i in range(N-2):
L = set([A[i], A[i+1], A[i+2]])
if len(L)<3:
continue
if A[i+1]==min(L) or A[i+1]==max(L):
cnt+=1
print(cnt)