結果
| 問題 | No.116 門松列(1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-03 18:57:46 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 5,000 ms |
| コード長 | 218 bytes |
| 記録 | |
| コンパイル時間 | 140 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 52,224 KB |
| 最終ジャッジ日時 | 2026-05-16 00:08:45 |
| 合計ジャッジ時間 | 1,973 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)