BZOJ5119 CTT2017 Spanning Tree counting DP Division for FFT Stirling number __ Mathematics & Number Theory--the second kind of sterling

Source: Internet
Author: User

ctt= Tsinghua Training Topic

There are n n Dots, the right point for AI a_i, you want to connect a side, so that the picture into a tree.

For a d_i scheme T, the degree of the first I point is Di, and the value of the tree is:
Val (t) = (∏I=1NADIIDMI) (∑I=1NDMI) val (t) = (\prod_{i=1}^na_i^{d_i}d_i^m) (\sum_{i=1}^nd_i^m)
Find the value of all spanning trees and mod998244353 \bmod 998244353

n≤30000,m≤30 N\leq 30000,m\leq

It's easy to think of the prufer sequence

First take the child to simplify:
Ans= (∏I=1NADIIDMI) (∑I=1NDMI) =∑i=1ndmi (∏j=1nad

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.