<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yosupo</author_name>
  <author_url>https://blog.hatena.ne.jp/yosupo/</author_url>
  <blog_title>よすぽの日記</blog_title>
  <blog_url>https://yosupo.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>考察パート 求めたいのは木の重心みたいなやつ。 今見てる点に、markされた木の半分以上を持つ部分木があったらその方向に動く、みたいなのを繰り返すと行き着く場所。 頂点を1,2,...,nと塗っていって、その度にこの重心を求め、その点までの距離の総和を求めるという問題。 で、i+1番目まで塗られた時の重心はi番目まで塗られた時の重心と、頂点i+1のパスのうちどっかにあるってことがわかる。これが最重要。 これがわかるとHL分解やらLC-Treeで解ける。今回はLC-Treeを使った。 変数はいつもの(親と子のポインタとreverse_flagとsize)抜いて7個。めっちゃ大変。 Do use …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyosupo.hatenablog.com%2Fentry%2F2015%2F12%2F17%2F180901&quot; title=&quot;Distance Sum - よすぽの日記&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>2015-12-17 18:09:01</published>
  <title>Distance Sum</title>
  <type>rich</type>
  <url>https://yosupo.hatenablog.com/entry/2015/12/17/180901</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
