摘要:
Tree and Permutation 给出一个1,2,3...N的排列,显然全部共有N!种排列,每种排列的数字代表树上的一个结点,设Pi是其中第i种排列的相邻数字表示的结点的距离之和,让我们求sum(Pi)(1<=i<=N!)。 可以设dis(i, j)为树上任意两点间的最短距离,每两点之间的距 阅读全文
摘要:
码队的新桌游 树状数组、离散化、二维偏序 阅读全文
摘要:
struct Item { int a, b, c; int id; int ans; explicit Item(int _a = 0, int _b = 0, int _c = 0) : a(_a), b(_b), c(_c) {} }; struct cmpa { bool operator( 阅读全文