結果
| 問題 |
No.116 門松列(1)
|
| ユーザー |
|
| 提出日時 | 2022-02-20 21:04:10 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 34 ms / 5,000 ms |
| コード長 | 238 bytes |
| コンパイル時間 | 385 ms |
| コンパイル使用メモリ | 82,156 KB |
| 実行使用メモリ | 53,492 KB |
| 最終ジャッジ日時 | 2024-06-29 10:58:22 |
| 合計ジャッジ時間 | 1,802 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
n = int(input())
array = list(map(int,input().split()))
count=0
for i in range(0,n-2):
v_i = array[i:i+3]
v = list(sorted(v_i))
if len(list(set(v)))==3 and (v[1]==v_i[0] or v[1]==v_i[2]):
count+=1
print(count)