<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mayokoex</author_name>
  <author_url>https://blog.hatena.ne.jp/mayokoex/</author_url>
  <blog_title>mayoko’s diary</blog_title>
  <blog_url>https://mayokoex.hatenablog.com/</blog_url>
  <categories>
    <anon>CodeForces</anon>
  </categories>
  <description>こんな簡単に解けると思ってなかったので目からウロコでした。 問題 codeforces.com 解法 dp[n][sum] = ([1, n], [2, n], ..., [n-1, n] という区間で, 和が sum になる場合の数) というのを考えます(antimatter の分はマイナスで数えるので, 要するに dp[n][0] の和が答えになります。ただ, コード上 dp[5][-4] とかは出来ないので下のコードでは MAX 分だけオフセットをとっていると)。まず, 普通に dp[n-1][sum] を使って, dp[n][sum+a], dp[n][sum-a] に場合の数を伝搬さ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmayokoex.hatenablog.com%2Fentry%2F2016%2F03%2F15%2F164050&quot; title=&quot;Codeforces Round #225 (Div. 1) D. Antimatter - mayoko’s diary&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-03-15 16:40:50</published>
  <title>Codeforces Round #225 (Div. 1) D. Antimatter</title>
  <type>rich</type>
  <url>https://mayokoex.hatenablog.com/entry/2016/03/15/164050</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
