mirror of
https://github.com/xlucn/PAT.git
synced 2026-11-06 12:37:56 +08:00
16 lines
1.3 KiB
HTML
16 lines
1.3 KiB
HTML
Keep at Most 100 Characters
|
|
<div class="ques-view"><p>Given a string which contains only lower case letters, how many different non-empty strings you can get if you can keep <strong>AT MOST</strong> 100 characters in the original order? (Note: The string obtained is a "sub-sequence" of the original string.)</p>
|
|
<h3 id="input-specification-">Input Specification:</h3>
|
|
<p>Each input file contains one test case, which is only one line containing the string whose length is no larger than 1000.</p>
|
|
<h3 id="output-specification-">Output Specification:</h3>
|
|
<p>Output the number of different non-empty strings if you can only keep at most 100 characters. <strong>Since the answer might be super large, you only need to output the answer modulo 1000000007.</strong></p>
|
|
<h3 id="sample-input-">Sample Input:</h3>
|
|
<pre><code class="lang-in">aabac
|
|
</code></pre>
|
|
<h3 id="sample-output-">Sample Output:</h3>
|
|
<pre><code class="lang-out">19
|
|
</code></pre>
|
|
<h3 id="hint-">Hint:</h3>
|
|
<p>The strings are:</p>
|
|
<p><code>a</code>, <code>b</code>, <code>c</code>, <code>aa</code>, <code>ab</code>, <code>ac</code>, <code>ba</code>, <code>bc</code>, <code>aab</code>, <code>aaa</code>, <code>aac</code>, <code>aba</code>, <code>abc</code>, <code>bac</code>, <code>aaba</code>, <code>aabc</code>, <code>abac</code>, <code>aaac</code>, and <code>aabac</code>.</p>
|
|
</div> |