Files
PAT/source/html/b1040.html
T

14 lines
1.8 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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.
有几个PAT
<div class="ques-view"><p>字符串 <code>APPAPT</code> 中包含了两个单词 <code>PAT</code>,其中第一个 <code>PAT</code> 是第 2 位(<code>P</code>),第 4 位(<code>A</code>),第 6 位(<code>T</code>);第二个 <code>PAT</code> 是第 3 位(<code>P</code>),第 4 位(<code>A</code>),第 6 位(<code>T</code>)。</p>
<p>现给定字符串,问一共可以形成多少个 <code>PAT</code>?</p>
<h3 id="-">输入格式:</h3>
<p>输入只有一行,包含一个字符串,长度不超过<span class="katex"><span class="katex-mathml"><math><mrow><mn>1</mn><msup><mn>0</mn><mn>5</mn></msup></mrow>10^5</math></span><span aria-hidden="true" class="katex-html"><span class="strut" style="height:0.8141079999999999em;"></span><span class="strut bottom" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="base textstyle uncramped"><span class="mord mathrm">1</span><span class="mord"><span class="mord mathrm">0</span><span class="msupsub"><span class="vlist"><span style="top:-0.363em;margin-right:0.05em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle uncramped mtight"><span class="mord mathrm mtight">5</span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span>​</span></span></span></span></span></span></span>,只包含 <code>P</code>、<code>A</code>、<code>T</code> 三种字母。</p>
<h3 id="-">输出格式:</h3>
<p>在一行中输出给定字符串中包含多少个 <code>PAT</code>。由于结果可能比较大,只输出对 1000000007 取余数的结果。</p>
<h3 id="-">输入样例:</h3>
<pre><code class="lang-in">APPAPT
</code></pre>
<h3 id="-">输出样例:</h3>
<pre><code class="lang-out">2
</code></pre>
</div>