22192_Degree-constrainedspanningtree

2022-5-16 18:21| 发布者: Hocassian| 查看: 32| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506188990700-Problem List-采集的数据-后羿采集器.html

Pro.ID

22192

Title

Degree-constrained spanning tree

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22192

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    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
    3 2 10000
    4 2 10000
    10 3 10000

    Sample Output

    0
    3
    12
    800

    Source

    样例输入

    3 1 10000
    3 2 10000
    4 2 10000
    10 3 10000

    样例输出

    0
    3
    12
    800

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部