結果
| 問題 | No.116 門松列(1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-04-23 22:33:22 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 90 ms / 5,000 ms |
| コード長 | 371 bytes |
| 記録 | |
| コンパイル時間 | 136 ms |
| コンパイル使用メモリ | 77,488 KB |
| 最終ジャッジ日時 | 2025-12-03 14:44:38 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#!/usr/bin/python
from itertools import izip, islice
each_cons = lambda xs, n: izip(*(islice(xs, i, None) for i in xrange(n)))
def valid(a, b, c):
if len(set((a, b, c))) != 3:
return 0
_, y, _ = sorted((a, b, c))
return y == a or y == c
n = int(raw_input())
As = map(int, raw_input().split())
print len(filter(lambda x: valid(*x), each_cons(As, 3)))