結果

問題 No.116 門松列(1)
ユーザー yuki2006yuki2006
提出日時 2015-01-04 20:27:36
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 83 ms / 5,000 ms
コード長 368 bytes
コンパイル時間 2,154 ms
コンパイル使用メモリ 77,668 KB
実行使用メモリ 76,572 KB
最終ジャッジ日時 2023-09-07 06:31:16
合計ジャッジ時間 5,638 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
76,312 KB
testcase_01 AC 77 ms
76,564 KB
testcase_02 AC 77 ms
76,160 KB
testcase_03 AC 77 ms
76,260 KB
testcase_04 AC 77 ms
76,160 KB
testcase_05 AC 76 ms
76,312 KB
testcase_06 AC 77 ms
76,372 KB
testcase_07 AC 77 ms
76,296 KB
testcase_08 AC 78 ms
76,304 KB
testcase_09 AC 77 ms
76,408 KB
testcase_10 AC 77 ms
76,496 KB
testcase_11 AC 77 ms
76,096 KB
testcase_12 AC 78 ms
76,572 KB
testcase_13 AC 79 ms
76,404 KB
testcase_14 AC 78 ms
76,368 KB
testcase_15 AC 77 ms
76,156 KB
testcase_16 AC 75 ms
76,104 KB
testcase_17 AC 80 ms
76,156 KB
testcase_18 AC 83 ms
76,372 KB
testcase_19 AC 78 ms
76,376 KB
testcase_20 AC 80 ms
76,092 KB
testcase_21 AC 78 ms
76,396 KB
testcase_22 AC 78 ms
76,432 KB
testcase_23 AC 77 ms
76,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
N = int(raw_input())
A = map(int, raw_input().split())

assert 3 <= N <= 100
assert all([1 <= A[i] <= 100 for i in xrange(N)])
assert len(A) == N


def check(B):
    d = sorted(B)
    if d[0] < d[1] < d[2]:
        if d[1] == B[0] or d[1] == B[2]:
            return True
    return False


print sum(check(A[i:i + 3]) for i in xrange(N - 2))

0