logo AlgoBeat OnlineJudge
登录 注册

#101522. [BZOJ 1522] [POI2006]Kry

内存限制:64 MiB 时间限制:5000 ms 标准输入输出
题目类型:传统 评测方式:文本比较
上传者: 匿名

题目描述

给定 个数 ,求一个序列 满足:

1.任意 2. 3.

求这样序列的个数。

输入格式

The first line of the standard input contains the number of elements , .

The second, last line of the standard input contains positive integers , separated by single spaces,.

输出格式

Your programme should write one integer to the standard output - total number of different crystals that can be created. You can assume that this number is less than .

样例

样例输入 #1

3
2 1 3

样例输出 #1

5