<?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 の偶奇で計算を分ける。整数 i と j を含む間の数の中で計算を繰り返した結果 1 になる回数が最大のものを求めて、その回数を出力せよ。解答 UVa の中で最も手を付けられるだろう問題の割にはメモ化再帰しないと恐らく解けない。 奇数の計算をした直後は値が増加するので 1 にはならない。よって偶数の分まで一度に計算してしまうとよい。 #include &lt;iostream&gt; #include &lt;algorithm&gt; using namespace std; #define MAX (1000000) int memo[MAX]; int solve(int const n) { if…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Flogfiles.hatenablog.com%2Fentry%2F20140902%2F1409643021&quot; title=&quot;UVa100 The 3n + 1 problem - 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 16:30:21</published>
  <title>UVa100 The 3n + 1 problem</title>
  <type>rich</type>
  <url>https://logfiles.hatenablog.com/entry/20140902/1409643021</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
