結果
| 問題 |
No.116 門松列(1)
|
| ユーザー |
ponponpop
|
| 提出日時 | 2018-10-06 14:31:12 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 5,000 ms |
| コード長 | 209 bytes |
| コンパイル時間 | 102 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-06-25 01:44:16 |
| 合計ジャッジ時間 | 1,671 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
n=int(input())
l=list(map(int,input().split()))
cnt=0
for i in range(n-2):
if(l[i]!=l[i+1] and l[i]!=l[i+2] and l[i+1]!=l[i+2] and not (l[i+2]>l[i+1]>l[i] or l[i+2]<l[i+1]<l[i])):
cnt+=1
print(cnt)
ponponpop