結果
| 問題 | No.116 門松列(1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-07-11 06:24:59 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 93 ms / 5,000 ms |
| + 508µs | |
| コード長 | 231 bytes |
| 記録 | |
| コンパイル時間 | 310 ms |
| コンパイル使用メモリ | 21,284 KB |
| 実行使用メモリ | 15,740 KB |
| 最終ジャッジ日時 | 2026-07-29 13:05:13 |
| 合計ジャッジ時間 | 3,990 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
n=int(input())
D=list(map(int,input().split()))
ans=0
for i in range(n-2):
A=D[i:i+3]
if len(set(A))!=3:continue
mx,mn=max(A),min(A)
A.remove(mx)
A.remove(mn)
if D[i]==A[0] or D[i+2]==A[0]:ans+=1
print(ans)