2015-11-14から1日間の記事一覧
問題 abc014.contest.atcoder.jp 解法 lca 使ってやるだけ。木構造では2つの頂点の距離が一意に決まるのが本質的? class Tree { public: Tree(int V, int root) : V(V), root(root) { T.resize(V); for (int i = 0; i < MAXLOGV; i++) parent[i].resize(V);…
問題 abc014.contest.atcoder.jp 解法 lca 使ってやるだけ。木構造では2つの頂点の距離が一意に決まるのが本質的? class Tree { public: Tree(int V, int root) : V(V), root(root) { T.resize(V); for (int i = 0; i < MAXLOGV; i++) parent[i].resize(V);…