22130_Countthespanningtrees

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

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

Pro.ID

22130

Title

Count the spanning trees

Title链接

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

AC

11

Submit

54

Ratio

20.37%

时间&空间限制

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

    There is a graph called pentagon-cycle.

    A pentagon-cycle has a cycle with n vertices and n edges in its center. For example Figure 1 shows a 4-sized pentagon-cycle.

    On each edge of the n-edge cycle, there is a pentagon containing the edge as one of it's five edges. Pentagon have common vertex only on the n-edge cycle. Give you the size of a pentagon-cycle n, you just tell me how many spanning frees there are in the graph.

    Notice: All tree vertices in the graph are different from others.

    Figure 1   4-sized pentagon-cycle

    输入

    A line contains integer n indicating the size of a pentagon-cycle ( 100 ≥ n ≥ 2 ).

    Input is terminated by EOF.

    输出

    Description

    There is a graph called pentagon-cycle.

    A pentagon-cycle has a cycle with n vertices and n edges in its center. For example Figure 1 shows a 4-sized pentagon-cycle.

    On each edge of the n-edge cycle, there is a pentagon containing the edge as one of it's five edges. Pentagon have common vertex only on the n-edge cycle. Give you the size of a pentagon-cycle n, you just tell me how many spanning frees there are in the graph.

    Notice: All tree vertices in the graph are different from others.

    Figure 1   4-sized pentagon-cycle

    Input

    A line contains integer n indicating the size of a pentagon-cycle ( 100 ≥ n ≥ 2 ).

    Input is terminated by EOF.

    Output

    A line containing an integer representing the number of spanning trees of the pentagon-cycle. In order to decrease the complexity of arithmetic, you must give the result mod 2007.

    Sample Input

    2

    Sample Output

    40

    Source

    样例输入

    2

    样例输出

    40

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部