結果
問題 | No.116 門松列(1) |
ユーザー |
![]() |
提出日時 | 2023-11-14 22:57:40 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 42 ms / 5,000 ms |
コード長 | 214 bytes |
コンパイル時間 | 572 ms |
コンパイル使用メモリ | 82,128 KB |
実行使用メモリ | 52,468 KB |
最終ジャッジ日時 | 2024-09-26 04:24:03 |
合計ジャッジ時間 | 2,154 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
N = int(input())A = list(map(int,input().split()))cnt=0for i in range(N-2):temp=[A[i],A[i+1],A[i+2]]if A[i]<A[i+1]>A[i+2] or A[i]>A[i+1]<A[i+2]:if A[i]!=A[i+2]:cnt+=1print(cnt)