8 人解决,23 人已尝试。
8 份提交通过,共有 37 份提交。
7.7 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
The problem is to calculate the coefficients in expansion of polynomial (x1+x2+…+xk)n.
The input will consist of N(0<N<3000) pairs of lines. The first line of the pair consists of two integers n and k separated with space (0 < k,n < 13). This integers define the power of the polynomial and the amount of the variables. The second line in each pair consists of k non-negative integers n1, …, nk, where n1+…+nk=n.
You can assume that all inputs are valid and can calculate the multiplication.
For each input pair of lines the output line should consist one integer, the coefficient by the monomial x1n1x2n2…xknk in expansion of the polynomial (x1+x2+…+xk)n.
2 2 2 1 1 2 12 1 0 0 0 0 0 0 0 0 0 1 0
2 2
8 人解决,23 人已尝试。
8 份提交通过,共有 37 份提交。
7.7 EMB 奖励。