結果
問題 |
No.116 門松列(1)
|
ユーザー |
|
提出日時 | 2017-12-31 00:39:45 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 268 bytes |
コンパイル時間 | 272 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-21 13:42:13 |
合計ジャッジ時間 | 1,758 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 11 WA * 10 |
ソースコード
n = int(input()) seq = input().split() count = 0 for i in range(n - 2): if seq[i] == seq[i+2]: break elif seq[i] > seq[i+1] and seq[i+1] < seq[i+2]: count += 1 elif seq[i] < seq[i+1] and seq[i+1] > seq[i+2]: count += 1 print(count)