<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mhiro216</author_name>
  <author_url>https://blog.hatena.ne.jp/mhiro216/</author_url>
  <blog_title>オットセイの経営日誌</blog_title>
  <blog_url>https://mhiro216.hatenablog.com/</blog_url>
  <categories>
    <anon>競技プログラミング</anon>
  </categories>
  <description>1週間遅れですが、ABCで木構造の問題が解けなかったので、2度同じ間違いを繰り返さぬようメモります。 問題内容・解法 D - Ki atcoder.jp 問題文その通りの考え方をすると、以下のように計算されていくことになります（ピンクの丸が頂点id、白い丸が値）。 しかし、このロジックのまま実装すると何度も下層に降りて和を計算する必要があるため、非効率です。 このようなケースの常套手段として、累積和をとる方法があります。図にすると以下のような考え方です。 各頂点直下の頂点にのみ値を足し、足された値をまた直下の頂点に足すことで、結果的に問題文の指示通りの和が計算されることになります。 さて、この…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmhiro216.hatenablog.com%2Fentry%2F2019%2F08%2F25%2F110013&quot; title=&quot;木構造のDFS（AtCoder Beginner Contest 138より） - オットセイの経営日誌&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>https://chart.apis.google.com/chart?cht=tx&amp;chl=%20O%28n%20%2A%20h%29</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-08-25 11:00:13</published>
  <title>木構造のDFS（AtCoder Beginner Contest 138より）</title>
  <type>rich</type>
  <url>https://mhiro216.hatenablog.com/entry/2019/08/25/110013</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
