結果
問題 | No.116 門松列(1) |
ユーザー |
|
提出日時 | 2015-01-04 20:27:36 |
言語 | PyPy2 (7.3.15) |
結果 |
AC
|
実行時間 | 74 ms / 5,000 ms |
コード長 | 368 bytes |
コンパイル時間 | 1,569 ms |
コンパイル使用メモリ | 76,928 KB |
実行使用メモリ | 75,904 KB |
最終ジャッジ日時 | 2024-06-25 00:54:29 |
合計ジャッジ時間 | 4,418 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
# -*- 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))