<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>babcs2035</author_name>
  <author_url>https://blog.hatena.ne.jp/babcs2035/</author_url>
  <blog_title>きろく</blog_title>
  <blog_url>https://babcs2035.hateblo.jp/</blog_url>
  <categories>
    <anon>競技プログラミング</anon>
    <anon>AtCoder 400 点問題</anon>
  </categories>
  <description>問題 D - Equals 1~N の順列 p の中で (x,y) 番目のものを swap 出来るとき、最大でいくつの数をもとの位置に戻せるか、という問題。 解法 順列内の数を頂点、swap 出来る関係を辺として図を書いてみると、連結な部分は連結の範囲の中の任意の場所に移動可能だとわかる。あとは、順列内の数と元の場所とが同じ連結部分に属するかを調べたいので Union-Find 木 を使う。シンプル。O(NlogN)。 解答 Submission #2635001 - AtCoder Regular Contest 097 一発 AC だった（うれしいね）。</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbabcs2035.hateblo.jp%2Fentry%2F2018%2F06%2F08%2F221612&quot; title=&quot;AtCoder Regular Contest 097 : D - Equals - きろく&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://cdn-ak.f.st-hatena.com/images/fotolife/b/babcs2035/20180608/20180608221424.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-06-08 22:16:12</published>
  <title>AtCoder Regular Contest 097 : D - Equals</title>
  <type>rich</type>
  <url>https://babcs2035.hateblo.jp/entry/2018/06/08/221612</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
