<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ThreeStones</author_name>
  <author_url>https://blog.hatena.ne.jp/ThreeStones/</author_url>
  <blog_title>ThreeStonesのアレ</blog_title>
  <blog_url>https://threestones.hateblo.jp/</blog_url>
  <categories>
    <anon>読書</anon>
  </categories>
  <description>問題概要 重さwと価値vがついた品物がn個ある。 これらの品物から、重さの総和がWを超えないように選んだときの 価値の総和の最大値を求めなさい。 問題解法 1.全探索 再帰的に、品物をチェックし入れた場合、入れなかった場合とで探索を繰り返す。 重さの総和が超えたり、すべての品物を探索し終えた場合に再帰終了とする。 ▶︎指数時間かかってしまう。2.メモ化 再帰的に呼び出す際、何度も同じ引数による関数呼び出しが発生する。 一度探索している状態については、あらかじめ配列等に結果を「メモ」しておき、 呼ばれるたびに、すでに探索済みか確認し、探索が終えていれば再帰を行わない。3.動的計画法 漸化式を作る…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fthreestones.hateblo.jp%2Fentry%2F2014%2F06%2F29%2F145755&quot; title=&quot;動的計画法part1(ナップザック問題) - ThreeStonesのアレ&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>2014-06-29 14:57:55</published>
  <title>動的計画法part1(ナップザック問題)</title>
  <type>rich</type>
  <url>https://threestones.hateblo.jp/entry/2014/06/29/145755</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
