Pro.ID22130 TitleCount the spanning trees Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22130 AC11 Submit54 Ratio20.37% 时间&空间限制描述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 作者 |