<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mayokoex</author_name>
  <author_url>https://blog.hatena.ne.jp/mayokoex/</author_url>
  <blog_title>mayoko’s diary</blog_title>
  <blog_url>https://mayokoex.hatenablog.com/</blog_url>
  <categories>
    <anon>CodeForces</anon>
  </categories>
  <description>問題 codeforces.com 解法 まず普通に MST を作ります。で, その木に辺 (u, v) を追加したと考えると, 閉路が出来ます。閉路のいずれかの辺を取り除くと再び木になるので, 閉路の中からコストが最大の辺を取り除けば良いです。最大の辺はどうやって取り除けば良いかというと, ダブリングのテクニックを使います。maxCost[k][v] = (頂点 v から v より 2^k 個だけ上にある頂点までの辺の最大コスト) というのを保存しておけば, lca を求めるのと同様の手法で頂点の組 (u, v) における, u -&gt; lca -&gt; v の間の辺の最大コストが O(log N…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmayokoex.hatenablog.com%2Fentry%2F2016%2F02%2F11%2F201919&quot; title=&quot;Educational Codeforces Round 3 E. Minimum spanning tree for each edge - mayoko’s diary&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>2016-02-11 20:19:19</published>
  <title>Educational Codeforces Round 3 E. Minimum spanning tree for each edge</title>
  <type>rich</type>
  <url>https://mayokoex.hatenablog.com/entry/2016/02/11/201919</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
