HBC204604Rooted Tree题解

三分之二給你 算法基础篇 51 0
不断提升技能,才能在职场中立于不败之地!全网最全C++题库,助您成为编程领域的佼佼者。
Already been college students, Jack and Rose start to work out problems of discrete mathematics. Jack emerges great interest in rooted tree, which is a kind of directed tree that has a root vertex.

Already been college students, Jack and Rose start to work out problems of discrete mathematics. Jack emerges great interest in rooted tree, which is a kind of directed tree that has a root vertex. In a rooted tree, define the depth of vertex u{u}u depth(u) as the number of edges between root vertex and u{u}u. And the depth of a rooted tree is the maximum depth among all vertices of this tree. The problem is to count the number of rooted trees that have n vertices, whose depth are not more than two, and are not isomorphism with each other. The answer should module 998244353{998244353}998244353. Isomorphismtextit{Isomorphism}Isomorphism: Rooted tree T1=⟨V1,E1⟩T1=langle V1,E1 rangleT1=⟨V1,E1⟩ and T2=⟨V2,E2⟩T2=langle V2,E2 rangleT2=⟨V2,E2⟩ are isomorphism if and only if there exists such a bijection f:V1→V2f:V1 to V2f:V1→V2 that satisfying to any u,v∈V1u,v in V1u,v∈V1, ⟨u,v⟩∈E1langle u,v rangle in E1⟨u,v⟩∈E1 when and only when ⟨f(u),f(v)⟩∈E2langle f(u),f(v) rangle in E2⟨f(u),f(v)⟩∈E2. Bijection (bijective function)textit{Bijection (bijective function)}Bijection (bijective function): A kind of function between the elements of two set, where each element of one set is paired with exactly one element of the other set, and each element of the other set is paired with exactly one element of the first set.

HBC204604Rooted Tree题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
成为编程大师,不再是梦想!全网最全C++题库,助您开启编程新篇章。

标签: HBC204604Rooted Tree题解