Splay的简单应用,找和一个数最接近的数,例如找和x最接近的数,把x旋转到根,要么是左子树的最大值,要么是右子树的最小值。 #include <cstdio>#include <cstring>#include <algorithm>#include <cstdlib>using namespace std;typedef long long LL;const int mod =
[Poi2014] Rally @Description@@Solution - Part 1@@Solution - Part 2@@Some Details@@Code@@End@ @Description@ 给定一个N个点M条边的有向无环图,每条边长度都是1。 请找到一个点,使得删掉这个点后剩余的图中的最长路径最短。 Input 第一行包含两个正整数 N , M (