4547专题

hdu 4547 CD操作(金山居 LCA算法)

LCA算法:首先用CD ..回退到公共最近最现,再一次性到达目的地。 #include <iostream>#include <cstdio>#include <cstring>#include <string>#include <map>using namespace std;const int maxn = 100006;int dp[maxn][20], father