Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

Decomposition of Paths

Правка en1, от aloo_parantha, 2020-12-27 09:10:37

You are given a tree that contains vertices and queries. Each query is determining the number of decompositions of the tree into paths and the path from to that is one of the paths in the decomposition modulo 998244353.

A tree decomposition in paths is valid if each vertex belongs to exactly one path. A path can be a single vertex. Two decompositions are different if there are two vertices and that belong to the same path in one of the decompositions but two distinct paths in the other.

Sample Input: 5 2 3 1 4 1 1 5 2 5 3 3 2 5

Output : 8 4

Can anyone please explain this problem with an example... Problem Link : https://www.hackerearth.com/problem/algorithm/path-decomposition-ii-ad4b4a0c/

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en5 Английский aloo_parantha 2020-12-27 09:14:13 76
en4 Английский aloo_parantha 2020-12-27 09:13:14 31
en3 Английский aloo_parantha 2020-12-27 09:12:34 26
en2 Английский aloo_parantha 2020-12-27 09:12:02 94
en1 Английский aloo_parantha 2020-12-27 09:10:37 749 Initial revision (published)