<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>parukii</author_name>
  <author_url>https://blog.hatena.ne.jp/parukii/</author_url>
  <blog_title>parukiのブログ</blog_title>
  <blog_url>https://par.hateblo.jp/</blog_url>
  <categories>
  </categories>
  <description>とりあえず1を根とする根付き木として考える。 f[i][j][k] := 頂点iについて、頂点iの子孫のうち、iからその子孫までのパスの距離のjビット目がkであるような子孫の数 とする。これをメモ化再帰で解く。 ある頂点uについて uが最も根に近い頂点であるようなパスは、uと子孫との関係から3パターンがある。 つまりvとwをuの子孫として(u,v,wはすべて異なる) (1) v &lt;=&gt; u&lt;=&gt; w (2) u &lt;=&gt; v (3) u これらを f[u][j][k]を計算しながら、uが最も根に近い頂点であるようなパスの距離の和g[u]を求める。Σ(g[u])が解</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpar.hateblo.jp%2Fentry%2F2017%2F02%2F09%2F150410&quot; title=&quot;Codeforces #396 Div. 2 E:  Mahmoud and a xor trip - parukiのブログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-02-09 15:04:10</published>
  <title>Codeforces #396 Div. 2 E:  Mahmoud and a xor trip</title>
  <type>rich</type>
  <url>https://par.hateblo.jp/entry/2017/02/09/150410</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
