Pro.ID22860 TitleSum to N Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22860 AC52 Submit140 Ratio37.14% 时间&空间限制描述Find all ways + or - can be substituted for the @ symbol in a prototype equation like the one below such that the expression is true for a specified N (4 ≤ N ≤ 24). Count the number of distinct arrangements. -1 @ 2 @ 3 @ 4 @ 5 ... @ N-2 @ N-1 = N 输入多测试用例。 A single line with the integer N. 输出Description Find all ways + or - can be substituted for the @ symbol in a prototype equation like the one below such that the expression is true for a specified N (4 ≤ N ≤ 24). Count the number of distinct arrangements. -1 @ 2 @ 3 @ 4 @ 5 ... @ N-2 @ N-1 = N Input 多测试用例。 A single line with the integer N. Output A single line with the integer that is the number of distinct ways the expression can be made true. Sample Input 8 Sample Output 4 Hint Namely: -1 - 2 - 3 - 4 + 5 + 6 + 7 = 8 -1 - 2 + 3 + 4 + 5 + 6 - 7 = 8 -1 + 2 - 3 + 4 + 5 - 6 + 7 = 8 -1 + 2 + 3 - 4 - 5 + 6 + 7 = 8 Source 样例输入8 样例输出4 提示Namely: -1 - 2 - 3 - 4 + 5 + 6 + 7 = 8 -1 - 2 + 3 + 4 + 5 + 6 - 7 = 8 -1 + 2 - 3 + 4 + 5 - 6 + 7 = 8 -1 + 2 + 3 - 4 - 5 + 6 + 7 = 8 |