Files
PAT/source/html/b1084.html
T

15 lines
1.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
外观数列
<div class="ques-view"><p>外观数列是指具有以下特点的整数序列:</p>
<pre><code>d, d1, d111, d113, d11231, d112213111, ...
</code></pre><p>它从不等于 1 的数字 <code>d</code> 开始,序列的第 n+1 项是对第 n 项的描述。比如第 2 项表示第 1 项有 1 个 <code>d</code>,所以就是 <code>d1</code>;第 2 项是 1 个 <code>d</code>(对应 <code>d1</code>)和 1 个 1(对应 11),所以第 3 项就是 <code>d111</code>。又比如第 4 项是 <code>d113</code>,其描述就是 1 个 <code>d</code>,2 个 1,1 个 3,所以下一项就是 <code>d11231</code>。当然这个定义对 <code>d</code> = 1 也成立。本题要求你推算任意给定数字 <code>d</code> 的外观数列的第 N 项。</p>
<h3 id="-">输入格式:</h3>
<p>输入第一行给出 [0,9] 范围内的一个整数 <code>d</code>、以及一个正整数 N(<span class="katex"><span class="katex-mathml"><math><mrow><mo>≤</mo></mrow>\le</math></span><span aria-hidden="true" class="katex-html"><span class="strut" style="height:0.63597em;"></span><span class="strut bottom" style="height:0.7719400000000001em;vertical-align:-0.13597em;"></span><span class="base textstyle uncramped"><span class="mrel">≤</span></span></span></span> 40),用空格分隔。</p>
<h3 id="-">输出格式:</h3>
<p>在一行中给出数字 <code>d</code> 的外观数列的第 N 项。</p>
<h3 id="-">输入样例:</h3>
<pre><code class="lang-in">1 8
</code></pre>
<h3 id="-">输出样例:</h3>
<pre><code class="lang-out">1123123111
</code></pre>
</div>