摘要:
Discription Bear Limak examines a social network. Its main functionality is that two members can become friends (then they can talk with each other an 阅读全文
摘要:
Discription The Little Elephant loves permutations of integers from 1 to n very much. But most of all he loves sorting them. To sort a permutation, th 阅读全文
摘要:
大意就是给你一颗树,每个点有一个权值w[i],求一个排列使得 所有的父亲都在儿子前面 并且排列的权值最小。 排列的权值在这里定义为 Σ i * w[p[i]] ,其中p[i] 是排列第i个位置的元素。 然后我瞎jb胡了一个算法,对于每个子树维护一个 p[],表示只考虑子树内的元素的最优排列。显然我们 阅读全文