Orange Boy Can You Solve It Out? Ep. 46
chemistry 思考题
Hydrocarbon
Ninetail is building a tree.
She has nodes and she will assign a value from 0 to 3 to each node. All nodes with the same value are indistinguishable.
Then she will connect the nodes with edges so that they form a tree. She will also assign a value from 1 to 3 to each edge.
Unfortunately, she doesn't realize the nodes she is using are bombs!!! For any node , if the sum of the value of the node and all the edges connected to it isn't 4, i.e. , it will explode and Ninetail will die!!!
Moreover, if where M is a given integer the tree will fall apart and explode.
After surviving the bomb attack, Ninetail wonders how many different trees are there.
Multi-task
If you can output whether there is a tree that meets the given requirement, you can get 20% of the score.
If you can output any of the possible tree structures, you can get another 30% of the score.
If you can print the number of different trees, you can get the rest 50%.
Note
A possible answer for is
(2)-2-(1)-1-(3)
Note that
(2)-2-(1)-1-(3)
and (3)-2-(1)-1-(2)
are considered the same.
版权声明:
作者:XGN
链接:https://blog.hellholestudios.top/archives/540
来源:Hell Hole Studios Blog
文章版权归作者所有,未经允许请勿转载。
共有 0 条评论