HBC51180Triangles,思维Accumulation Degree题解

爱的那么颓废 数据结构基础 63 0
题库丰富多样,涵盖各个领域,全网最全C++题库,让您在练习中不断成长!

Trees are an important component of the natural landscape because of their prevention of erosion and the provision of a specific ather-sheltered ecosystem in and under their foliage. Trees have also been found to play an important role in producing oxygen and reducing carbon dioxide in the atmosphere, as well as moderating ground temperatures. They are also significant elements in landscaping and agriculture, both for their aesthetic appeal and their orchard crops (such as apples). Wood from trees is a common building material. Trees also play an intimate role in many of the world's mythologies. Many scholars are interested in finding peculiar properties about trees, such as the center of a tree, tree counting, tree coloring. A(x) is one of such properties. A(x) (accumulation degree of node x) is defined as follows: Each edge of the tree has an positive capacity. The nodes with degree of one in the tree are named terminals. The flow of each edge can't exceed its capacity. A(x) is the maximal flow that node x can flow to other terminal nodes. Since it may be hard to understand the definition, an example is showed below: A(1)=11+5+8=24 Details: 1->2 11 1->4->3 5 1->4->5 8(since 1->4 has capacity of 13) A(2)=5+6=11 Details: 2->1->4->3 5 2->1->4->5 6 A(3)=5 Details: 3->4->5 5 A(4)=11+5+10=26 Details: 4->1->2 11 4->3 5 4->5 10 A(5)=10 Details: 5->4->1->2 10 The accumulation degree of a tree is the maximal accumulation degree among its nodes. Here your task is to find the accumulation degree of the given trees.

不断学习,不断挑战,才能在编程领域中脱颖而出!全网最全C++题库,助您成为编程高手!

标签: HBC51180Triangles 思维Accumulation Degree题解