Files
PAT/source/html/a1035.html
T

33 lines
4.4 KiB
HTML

Password
<div class="ques-view"><p>To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish <code>1</code> (one) from <code>l</code> (<code>L</code> in lowercase), or <code>0</code> (zero) from <code>O</code> (<code>o</code> in uppercase). One solution is to replace <code>1</code> (one) by <code>@</code>, <code>0</code> (zero) by <code>%</code>, <code>l</code> by <code>L</code>, and <code>O</code> by <code>o</code>. Now it is your job to write a program to check the accounts generated by the judge, and to help the juge modify the confusing passwords.</p>
<h3 id="input-specification-">Input Specification:</h3>
<p>Each input file contains one test case. Each case contains a positive integer <span class="katex"><span class="katex-mathml"><math><mrow><mi>N</mi></mrow>N</math></span><span aria-hidden="true" class="katex-html"><span class="strut" style="height:0.68333em;"></span><span class="strut bottom" style="height:0.68333em;vertical-align:0em;"></span><span class="base textstyle uncramped"><span class="mord mathit" style="margin-right:0.10903em;">N</span></span></span></span> (<span class="katex"><span class="katex-mathml"><math><mrow><mo>≤</mo><mn>1</mn><mn>0</mn><mn>0</mn><mn>0</mn></mrow>\le 1000</math></span><span aria-hidden="true" class="katex-html"><span class="strut" style="height:0.64444em;"></span><span class="strut bottom" style="height:0.78041em;vertical-align:-0.13597em;"></span><span class="base textstyle uncramped"><span class="mrel">≤</span><span class="mord mathrm">1</span><span class="mord mathrm">0</span><span class="mord mathrm">0</span><span class="mord mathrm">0</span></span></span></span>), followed by <span class="katex"><span class="katex-mathml"><math><mrow><mi>N</mi></mrow>N</math></span><span aria-hidden="true" class="katex-html"><span class="strut" style="height:0.68333em;"></span><span class="strut bottom" style="height:0.68333em;vertical-align:0em;"></span><span class="base textstyle uncramped"><span class="mord mathit" style="margin-right:0.10903em;">N</span></span></span></span> lines of accounts. Each account consists of a user name and a password, both are strings of no more than 10 characters with no space.</p>
<h3 id="output-specification-">Output Specification:</h3>
<p>For each test case, first print the number <span class="katex"><span class="katex-mathml"><math><mrow><mi>M</mi></mrow>M</math></span><span aria-hidden="true" class="katex-html"><span class="strut" style="height:0.68333em;"></span><span class="strut bottom" style="height:0.68333em;vertical-align:0em;"></span><span class="base textstyle uncramped"><span class="mord mathit" style="margin-right:0.10903em;">M</span></span></span></span> of accounts that have been modified, then print in the following <span class="katex"><span class="katex-mathml"><math><mrow><mi>M</mi></mrow>M</math></span><span aria-hidden="true" class="katex-html"><span class="strut" style="height:0.68333em;"></span><span class="strut bottom" style="height:0.68333em;vertical-align:0em;"></span><span class="base textstyle uncramped"><span class="mord mathit" style="margin-right:0.10903em;">M</span></span></span></span> lines the modified accounts info, that is, the user names and the corresponding modified passwords. The accounts must be printed in the same order as they are read in. If no account is modified, print in one line <code>There are N accounts and no account is modified</code> where <code>N</code> is the total number of accounts. However, if <code>N</code> is one, you must print <code>There is 1 account and no account is modified</code> instead.</p>
<h3 id="sample-input-1-">Sample Input 1:</h3>
<pre><code class="lang-in">3
Team000002 Rlsp0dfa
Team000003 perfectpwd
Team000001 R1spOdfa
</code></pre>
<h3 id="sample-output-1-">Sample Output 1:</h3>
<pre><code class="lang-out">2
Team000002 RLsp%dfa
Team000001 R@spodfa
</code></pre>
<h3 id="sample-input-2-">Sample Input 2:</h3>
<pre><code class="lang-in">1
team110 abcdefg332
</code></pre>
<h3 id="sample-output-2-">Sample Output 2:</h3>
<pre><code class="lang-out">There is 1 account and no account is modified
</code></pre>
<h3 id="sample-input-3-">Sample Input 3:</h3>
<pre><code class="lang-in">2
team110 abcdefg222
team220 abcdefg333
</code></pre>
<h3 id="sample-output-3-">Sample Output 3:</h3>
<pre><code class="lang-out">There are 2 accounts and no account is modified
</code></pre>
</div>