3089: 【基础】算24点(2)

Memory Limit:128 MB Time Limit:1.000 S
Submit数:1 Solved数:1

Description

给出n个整数,请问这n个数字在不改变顺序且不加入括号的情况下,有多少种运算能得到24。

比如:4 10 2 4 8,有如下3种运算能够得到24。

4+10-2+4+8=24

4-10-2+4*8=24

4*10-2*4-8=24

Input描述

第1行有一个整数n;(2<=n<=10)

第2行有n个整数ai;(1<=ai<=100)

Output描述

一个整数,代表能计算出24点的方案数;

Sample Input Copy

5
4 10 2 4 8

Sample Output Copy

3

Source/Category

Problem :   3089        Language:        




    # 输入数据自测: