結果
| 問題 | No.116 門松列(1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-05-29 16:58:30 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
AC
|
| 実行時間 | 60 ms / 5,000 ms |
| + 717µs | |
| コード長 | 359 bytes |
| 記録 | |
| コンパイル時間 | 70 ms |
| コンパイル使用メモリ | 80,512 KB |
| 実行使用メモリ | 80,896 KB |
| 最終ジャッジ日時 | 2026-07-17 15:34:29 |
| 合計ジャッジ時間 | 2,927 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
# -*- 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