<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hamayanhamayan</author_name>
  <author_url>https://blog.hatena.ne.jp/hamayanhamayan/</author_url>
  <blog_title>はまやんはまやんはまやん</blog_title>
  <blog_url>https://blog.hamayanhamayan.com/</blog_url>
  <categories>
    <anon>競技プログラミング</anon>
  </categories>
  <description>https://yukicoder.me/problems/no/901 前提知識 LCA 解説 https://yukicoder.me/submissions/387110 この問題の上位互換であるが、本質的には同じ解法を使える。 与えられた頂点をEuler Tourでの順番にソートすると、(v1-&gt;v2の距離+v2-&gt;v3の距離+...+vN-&gt;v1の距離)/2が答えになる。 これはv1-&gt;v2-&gt;...-&gt;vN-&gt;v1とすると、辺をちょうど2回だけ通るパスになるためである。 ちょうど2回通る理由としては、Euler TourはDFSで順番に遷移していて、 その順番に並び替えたということ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.hamayanhamayan.com%2Fentry%2F2019%2F10%2F05%2F091050&quot; title=&quot;K-ary εxtrεεmε [yukicoder 901] - はまやんはまやんはまやん&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>2019-10-05 09:10:50</published>
  <title>K-ary εxtrεεmε [yukicoder 901]</title>
  <type>rich</type>
  <url>https://blog.hamayanhamayan.com/entry/2019/10/05/091050</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
