<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mmxsrup</author_name>
  <author_url>https://blog.hatena.ne.jp/mmxsrup/</author_url>
  <blog_title>srupのメモ帳</blog_title>
  <blog_url>https://mmxsrup.hatenablog.com/</blog_url>
  <categories>
    <anon>yukicoder</anon>
    <anon>メモ化再帰</anon>
    <anon>dfs</anon>
  </categories>
  <description>問題 問題概要 省略 解法 メモ化再帰で解いた。サンプルで与えられている図のように辺を張り、dp[i] := i番目の商品が必要な数 とおき、自分の子で必要なものの数から、i番目に必要な個数を計算する形にした。商品nが必要な個数は1個なので、dp[n - 1] = 1となり、それを基底部としている。ほかの部分はu -&gt; vとなっているとき、uの必要な個数は、(vの必要な個数)と(uからvを作るのに、必要な個数)の積でわかる。これをメモしながら、やっていけばいい。 ミス 図のグラフと逆向きのDAGではじめ書いたけど、TLE。治せなかった。 コード #include &lt;iostream&gt; #inc…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmmxsrup.hatenablog.com%2Fentry%2F2016%2F09%2F24%2F124158&quot; title=&quot;yukicoder No.30 たこやき工場 - srupのメモ帳&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-09-24 12:41:58</published>
  <title>yukicoder No.30 たこやき工場</title>
  <type>rich</type>
  <url>https://mmxsrup.hatenablog.com/entry/2016/09/24/124158</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
