<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>moistx</author_name>
  <author_url>https://blog.hatena.ne.jp/moistx/</author_url>
  <blog_title>Logfiles</blog_title>
  <blog_url>https://logfiles.hatenablog.com/</blog_url>
  <categories>
    <anon>UVa</anon>
  </categories>
  <description>概要 非負整数 n が与えられる。x. y, z を非負整数として、x+2y+2z = n となるパターン数を求めよ。 ただし n 解答 TLEにならないように一重ループ以内で解きたい。x+Y=n と書き換えると、Y は偶数である必要性が生じる。よって問題文を以下のように解釈し直す。 「n以下の非負整数xがある。n-x が偶数であるとき、 (n-x)/2 を２つに分けるパターン数を求めよ。」 すると以下のように O(n) で解が求まる。 #include &lt;iostream&gt; using namespace std; int main() { int n; while(cin &gt;&gt; n) { …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Flogfiles.hatenablog.com%2Fentry%2F20140902%2F1409647889&quot; title=&quot;UVa11296 Counting Solutions to an Integral Equation - Logfiles&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-09-02 17:51:29</published>
  <title>UVa11296 Counting Solutions to an Integral Equation</title>
  <type>rich</type>
  <url>https://logfiles.hatenablog.com/entry/20140902/1409647889</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
