結果
問題 | No.116 門松列(1) |
ユーザー |
![]() |
提出日時 | 2020-01-16 10:05:29 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 5,000 ms |
コード長 | 250 bytes |
コンパイル時間 | 271 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-23 10:31:51 |
合計ジャッジ時間 | 1,869 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
N=int(input())A=list(map(int,input().split()))tmp=[]cnt=0for i in range(N-2):a=A[i]b=A[i+1]c=A[i+2]tmp=[a,b,c]tmp.sort(reverse=True)if (tmp[1]==a or tmp[1]==c) and (a!=b and b!=c and c!=a):cnt+=1print(cnt)