結果
| 問題 | No.116 門松列(1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-07-11 06:24:59 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 107 ms / 5,000 ms |
| コード長 | 231 bytes |
| 記録 | |
| コンパイル時間 | 376 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 15,488 KB |
| 最終ジャッジ日時 | 2026-03-11 06:09:56 |
| 合計ジャッジ時間 | 3,744 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)