結果
問題 | No.116 門松列(1) |
ユーザー |
![]() |
提出日時 | 2016-02-27 16:08:56 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 13 ms / 5,000 ms |
コード長 | 251 bytes |
コンパイル時間 | 188 ms |
コンパイル使用メモリ | 6,940 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-25 01:14:57 |
合計ジャッジ時間 | 1,166 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
# -*- coding: utf-8 -*-N = input()cnt = 0ref = []Alist = map(int, raw_input().split())for i in range(0, len(Alist)-2):j = (Alist[i+2] - Alist[i+1]) * (Alist[i+1] - Alist[i])if j < 0 and Alist[i+2] != Alist[i]:cnt += 1print cnt