Expression
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 991 Accepted Submission(s): 597
Problem Description
Teacher Mai has n numbers a1,a2,⋯,anand n−1 operators("+", "-" or "*")op1,op2,⋯,opn−1, which are arranged in the form a1 op1 a2 op2 a3 ⋯ an.
He wants to erase numbers one by one. In i-th round, there are n+1−i numbers remained. He can erase two adjacent numbers and the operator between them, and then put a new number (derived from this one operation) in this position. After n−1 rounds, there is the only one number remained. The result of this sequence of operations is the last number remained.
He wants to know the sum of results of

该博客探讨了如何解决一个涉及区间动态规划和组合数的数学问题。教师想要计算一个包含多个数字和操作符的表达式在不同运算顺序下的所有可能结果之和,并给出了一种递归解决方案。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



