Pro.ID22192 TitleDegree-constrained spanning tree Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22192 AC0 Submit0 Ratio- 时间&空间限制描述In graph theory, a degree-constrained spanning tree is a spanning tree where the maximum vertex degree is limited to a certain constant k. Given two integers n and k, your task is to calculate the number of degree-constrained spanning trees of a (labeled) complete graph with n vertices. This number may be very large, so output the answer modulo p. 输入Each line contains three integers n, k, p. 1 ≤ n ≤ 100, 1 ≤ k ≤ 100, 1 ≤ p < 231. Input contain up to 300 cases. 输出Description In graph theory, a degree-constrained spanning tree is a spanning tree where the maximum vertex degree is limited to a certain constant k. Given two integers n and k, your task is to calculate the number of degree-constrained spanning trees of a (labeled) complete graph with n vertices. This number may be very large, so output the answer modulo p. Input Each line contains three integers n, k, p. 1 ≤ n ≤ 100, 1 ≤ k ≤ 100, 1 ≤ p < 231. Input contain up to 300 cases. Output For each query, output a line which contains only one integer. Sample Input 3 1 10000 Sample Output 0 Source 样例输入3 1 10000 样例输出0 作者 |