結果
問題 |
No.116 門松列(1)
|
ユーザー |
|
提出日時 | 2015-05-29 16:57:39 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 359 bytes |
コンパイル時間 | 130 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-06 10:58:38 |
合計ジャッジ時間 | 1,483 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 7 WA * 14 |
ソースコード
# -*- coding:utf-8 -*- if __name__ == "__main__": n = input() take = map(int,raw_input().split()) ans = 0 for i in xrange(1,n-1): if (take[i] > take[i-1] and take[i]) < take[i+1] or (take[i] < take[i-1] and take[i] > take[i+1]): continue if take[i] == take[i+1] or take[i] == take[i-1] or take[i+1] == take[i-1]: continue ans += 1 print ans