首页 / 软件开发 / 数据结构与算法 / 算法题:UVA 10105 Polynomial Coefficients(数论)
算法题:UVA 10105 Polynomial Coefficients(数论)2014-04-20 csdn博客 accelerator_Polynomial coefficientsThe ProblemThe problem is to calculate the coefficients in expansion of polynomial (x1+x2+...+xk)n.The InputThe input will consist of a set of pairs of lines. The first line of the pair consists of two integers n andk 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.The OutputFor each input pair of lines the output line should consist one integer, the coefficient by the monomialx1n1x2n2...xknk in expansion of the polynomial (x1+x2+...+xk) n.Sample Input2 21 12 121 0 0 0 0 0 0 0 0 0 1 0Sample Output22