Codeforces Round #291 (Div. 2) E. Darth Vader and Tree 矩阵

When Darth Vader gets bored, he sits down on the sofa, closes his eyes and thinks of an infinite rooted tree where each node has exactlynsons, at that for each node, the distance between it an itsi-th left child equals todi. The Sith Lord loves counting the number of nodes in the tree that are at a distance at mostxfrom the root. The distance is the sum of the lengths of edges on the path between nodes.

But he has got used to this activity and even grew bored of it. ‘Why does he do that, then?’ — you may ask. It’s just that he feels superior knowing that only he can solve this problem.

Do you want to challenge Darth Vader himself? Count the required number of nodes. As the answer can be rather large, find it modulo109+7.

,漫无目的的生活就像出海航行而没有指南针

Codeforces Round #291 (Div. 2) E. Darth Vader and Tree 矩阵

相关文章:

你感兴趣的文章:

标签云: