F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Counting spanning trees

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 335    Accepted Submission(s): 90


Problem Description
Everyone knows spanning trees, especially MST problem. But most of them are not familiar with degree constrained spanning tree.
a degree-constrained spanning tree is a spanning tree which the maximum vertex degree is limited to a certain constant d.
Given two integers n and d, your task is to count the number of degree constrained spanning trees of a (labeled) complete graph with n vertices.
 

Input
Each line contains two integers n, d. 1<=n<=100, 1<=k<=100.
 

Output
For each query, output a line which contains only one integer, 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 20090829.
 

Sample Input
3 1 3 2 4 2 10 3
 

Sample Output
0 3 12 3458313
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 13:16:12, Gzip enabled