题目:
Born Slippy
Time Limit: 12000/6000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 223 Accepted Submission(s): 65
Problem Description
Professor Zhang has a rooted tree, whose vertices are conveniently labeled by
1,2,...,n . And the
i -th vertex is assigned with weight
wi .
For each s∈{ 1,2,...,n} , Professor Zhang wants find a sequence of vertices v1,v2,...,vm such that:
1. v1=s and vi
For each s∈{ 1,2,...,n} , Professor Zhang wants find a sequence of vertices v1,v2,...,vm such that:
1. v1=s and vi