mirror of
https://github.com/xlucn/PAT.git
synced 2026-11-11 06:03:06 +08:00
23 lines
1.6 KiB
HTML
23 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
<style type="text/css">
|
|
.katex-html {display: none;}
|
|
.katex-mathml {font-size: 0px;}
|
|
.katex-mathml math mrow {font-size: 16px;}
|
|
</style>
|
|
<h1>Keep at Most 100 Characters</h1>
|
|
<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> |