<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>obelisk2</author_name>
  <author_url>https://blog.hatena.ne.jp/obelisk2/</author_url>
  <blog_title>Camera Obscura</blog_title>
  <blog_url>https://obelisk.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
    <anon>アルゴリズム</anon>
  </categories>
  <description>アルゴリズムを学ぼう作者: 川中真耶,杵渕朋彦,椎名俊輔出版社/メーカー: アスキー・メディアワークス発売日: 2012/05/30メディア: 大型本購入: 5人 クリック: 34回この商品を含むブログ (6件) を見る 次のような問題があります。 石の山があり、そこから二人で代わる代わる 1〜3 個の石を取ってゆく。最後の石を取った方が勝ちとする。 自分の番になって石が n 個あるとすると、ここで取るべき個数の最善手を与えるメソッド solve(n) を書け。 ただし、何個取っても負ける場合は 0 を返すものとする。 まずは素朴に再帰で書いてみました。残りの石が 1〜3 個のときは、それを取…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fobelisk.hatenablog.com%2Fentry%2F2016%2F03%2F07%2F000520&quot; title=&quot;メモ付き探索（Ruby） - Camera Obscura&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>http://ecx.images-amazon.com/images/I/51OiQJsKG9L.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-03-07 00:05:20</published>
  <title>メモ付き探索（Ruby）</title>
  <type>rich</type>
  <url>https://obelisk.hatenablog.com/entry/2016/03/07/000520</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
