結果
| 問題 | No.116 門松列(1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-09-04 12:02:37 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 92 ms / 5,000 ms |
| + 848µs | |
| コード長 | 199 bytes |
| 記録 | |
| コンパイル時間 | 317 ms |
| コンパイル使用メモリ | 21,288 KB |
| 実行使用メモリ | 15,740 KB |
| 最終ジャッジ日時 | 2026-07-29 13:17:19 |
| 合計ジャッジ時間 | 3,954 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
n = int(input())
a = list(map(int,input().split()))
res = 0
for i in range(n-2):
l = a[i:i+3]
mid = sorted(l)[1]
if max(l)!=mid and min(l)!=mid and l[1]!=mid:
res += 1
print(res)