<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ishikado</author_name>
  <author_url>https://blog.hatena.ne.jp/ishikado/</author_url>
  <blog_title>ishikadoのアルゴリズム勉強録</blog_title>
  <blog_url>https://ishikado.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>Daveのハノイの計算量はたかだかO(2^N)でありmax(N)=19なので、愚直にK手後のハノイの状態を求めることができる。 一方Earlの方法はO(3^N)なため、愚直なシミュレーションでは状態を求められない。 そこで、どのようにしてEarlのシミュレーションを行うかが問題となる。 ここで、一番下のdiskにのみ着目すると、通常のハノイのように手数を再帰的に計算していくことができることがわかる。 このため、先に3の累乗を前計算しておくことにより、たかだかO(N)でEarlのシミュレーションを実行することができる。最初に基底に向かうタイプの再帰苦手です。 #include &lt;iostream…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fishikado.hatenadiary.org%2Fentry%2F20120330%2F1333119670&quot; title=&quot;SRM 482 div1 Medium - ishikadoのアルゴリズム勉強録&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>2012-03-30 00:01:10</published>
  <title>SRM 482 div1 Medium</title>
  <type>rich</type>
  <url>https://ishikado.hatenadiary.org/entry/20120330/1333119670</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
